diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-03-12 16:15:13 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-03-12 16:17:38 +0100 |
commit | e4636012e002fdad551d99906758d4cb47eb78bf (patch) | |
tree | 100554f0857de7a74085c956f5dedb5e6bc96f4f | |
parent | 43a56e34e15269bfb0fa5d7392b7fc171e77506d (diff) | |
download | curl-bagder/ftp-leak-done.tar.gz |
ftp: fix memory leak in ftp_donebagder/ftp-leak-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
-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 |