aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-04-04 00:46:16 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-04-04 00:46:16 +0000
commit7d48d851a2d2a810f6acac1e31332737c23ec868 (patch)
tree53b4a5fbe0f753f3c9c02dbbb79028556a700367 /lib
parent6a2cecf153e93c549fca7c0c7eae42f503c77748 (diff)
Fixed a memory leak and improper shutdown on SFTP post-quote command failure.
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index ed4d2790a..bdf68397d 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -949,6 +949,7 @@ CURLcode Curl_sftp_done(struct connectdata *conn, CURLcode status,
bool premature)
{
struct SSHPROTO *sftp = conn->data->reqdata.proto.ssh;
+ CURLcode rc = CURLE_OK;
(void)premature; /* not used */
Curl_safefree(sftp->path);
@@ -959,10 +960,7 @@ CURLcode Curl_sftp_done(struct connectdata *conn, CURLcode status,
/* Before we shut down, see if there are any post-quote commands to send: */
if(!status && !premature && conn->data->set.postquote) {
- CURLcode result = sftp_sendquote(conn, conn->data->set.postquote);
-
- if (result != CURLE_OK)
- return result;
+ rc = sftp_sendquote(conn, conn->data->set.postquote);
}
if (sftp->sftp_handle) {
@@ -995,7 +993,7 @@ CURLcode Curl_sftp_done(struct connectdata *conn, CURLcode status,
(void)status; /* unused */
- return CURLE_OK;
+ return rc;
}
/* return number of received (decrypted) bytes */