mirror of
https://github.com/curl/curl.git
synced 2026-07-08 12:17:15 +03:00
curl: improved cleanup in upload error path
Memory leak found by torture test 58 Closes #4705
This commit is contained in:
parent
5a1b0f4c5b
commit
dc4900eea7
1 changed files with 7 additions and 6 deletions
|
|
@ -115,16 +115,17 @@ char *add_file_name_to_url(char *url, const char *filename)
|
|||
urlbuffer = aprintf("%s/%s", url, encfile);
|
||||
|
||||
curl_free(encfile);
|
||||
|
||||
if(!urlbuffer) {
|
||||
url = NULL;
|
||||
goto end;
|
||||
}
|
||||
|
||||
Curl_safefree(url);
|
||||
|
||||
if(!urlbuffer)
|
||||
return NULL;
|
||||
|
||||
url = urlbuffer; /* use our new URL instead! */
|
||||
}
|
||||
else
|
||||
Curl_safefree(url);
|
||||
}
|
||||
end:
|
||||
curl_easy_cleanup(curl);
|
||||
return url;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue