mirror of
https://github.com/curl/curl.git
synced 2026-07-23 09:27:17 +03:00
Free 'scp->path' in case of libssh2 setup failure.
This commit is contained in:
parent
381ccaa391
commit
438312f00e
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue