diff --git a/include/libssh/libsshpp.hpp b/include/libssh/libsshpp.hpp index 62cc7163..ab431d89 100644 --- a/include/libssh/libsshpp.hpp +++ b/include/libssh/libsshpp.hpp @@ -335,11 +335,10 @@ public: * @see ssh_get_issue_banner */ std::string getIssueBanner(){ - char *banner=ssh_get_issue_banner(c_session); - std::string ret; - if (banner) - { - ret= std::string(banner); + char *banner = ssh_get_issue_banner(c_session); + std::string ret = ""; + if (banner != NULL) { + ret = std::string(banner); ::free(banner); } return ret;