1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

libsshpp: Initialize the string returned by getIssueBanner()

Fixes T13

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-09-04 20:51:30 +02:00
parent e558827c4e
commit ba1ff992ce

View File

@@ -336,9 +336,8 @@ public:
*/ */
std::string getIssueBanner(){ std::string getIssueBanner(){
char *banner = ssh_get_issue_banner(c_session); char *banner = ssh_get_issue_banner(c_session);
std::string ret; std::string ret = "";
if (banner) if (banner != NULL) {
{
ret = std::string(banner); ret = std::string(banner);
::free(banner); ::free(banner);
} }