diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-03-12 16:15:13 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-03-12 19:53:05 +0100 |
commit | 8ed71fc4f7116288da75ed85e21fe8c53f4cdfb2 (patch) | |
tree | cf19c3ffece191e95baf8021211e7cba085641a5 /lib | |
parent | d1f40078c13e85c56332dcb7f908fe2a7b65eb22 (diff) | |
download | curl-8ed71fc4f7116288da75ed85e21fe8c53f4cdfb2.tar.gz |
ftp: fix memory leak in ftp_done
If after a transfer is complete Curl_GetFTPResponse() returns an error,
curl would not free the ftp->pathalloc block.
Found by torture-testing test 576
Closes #6737
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3325,8 +3325,10 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, connclose(conn, "Timeout or similar in FTP DONE operation"); /* close */ } - if(result) + if(result) { + Curl_safefree(ftp->pathalloc); return result; + } if(ftpc->dont_check && data->req.maxdownload > 0) { /* we have just sent ABOR and there is no reliable way to check if it was |