From: Gisle Vanem Date: Wed, 15 Nov 2006 05:35:35 +0000 (+0000) Subject: Call libssh2_session_free() to release memory allocated during X-Git-Tag: curl-7_16_1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8039a821b0f5b8c889c5ec0d9027d23581b336b;p=thirdparty%2Fcurl.git Call libssh2_session_free() to release memory allocated during libssh2 startup. --- diff --git a/lib/ssh.c b/lib/ssh.c index 9b56ebc7bf..dddd42d56a 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -303,6 +303,7 @@ CURLcode Curl_scp_connect(struct connectdata *conn, bool *done) if (libssh2_session_startup(scp->scpSession, sock)) { failf(data, "Failure establishing ssh session\n"); + libssh2_session_free(scp->scpSession); Curl_safefree(scp->path); return CURLE_FAILED_INIT; } @@ -395,6 +396,7 @@ CURLcode Curl_scp_connect(struct connectdata *conn, bool *done) if (!authed) { failf(data, "Authentication failure\n"); + libssh2_session_free(scp->scpSession); Curl_safefree(scp->path); return CURLE_FAILED_INIT; }