mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
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
This commit is contained in:
parent
d1f40078c1
commit
8ed71fc4f7
@ -3325,8 +3325,10 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
|
|||||||
connclose(conn, "Timeout or similar in FTP DONE operation"); /* close */
|
connclose(conn, "Timeout or similar in FTP DONE operation"); /* close */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result)
|
if(result) {
|
||||||
|
Curl_safefree(ftp->pathalloc);
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if(ftpc->dont_check && data->req.maxdownload > 0) {
|
if(ftpc->dont_check && data->req.maxdownload > 0) {
|
||||||
/* we have just sent ABOR and there is no reliable way to check if it was
|
/* we have just sent ABOR and there is no reliable way to check if it was
|
||||||
|
Loading…
Reference in New Issue
Block a user