From: Gisle Vanem Date: Tue, 14 Nov 2006 20:26:13 +0000 (+0000) Subject: Free 'scp->path' in case of libssh2 setup failure. X-Git-Tag: curl-7_16_1~164 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=438312f00e3813efe576a2d5d78844b5451b1f69;p=curl Free 'scp->path' in case of libssh2 setup failure. --- diff --git a/lib/ssh.c b/lib/ssh.c index f3cd99b33..9b56ebc7b 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -294,6 +294,7 @@ CURLcode Curl_scp_connect(struct connectdata *conn, bool *done) libssh2_realloc, NULL); if (scp->scpSession == NULL) { failf(data, "Failure initialising ssh session\n"); + Curl_safefree(scp->path); return CURLE_FAILED_INIT; } #ifdef CURL_LIBSSH2_DEBUG @@ -302,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"); + Curl_safefree(scp->path); return CURLE_FAILED_INIT; } @@ -393,6 +395,7 @@ CURLcode Curl_scp_connect(struct connectdata *conn, bool *done) if (!authed) { failf(data, "Authentication failure\n"); + Curl_safefree(scp->path); return CURLE_FAILED_INIT; }