mirror of https://github.com/moparisthebest/curl
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
|
@ -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…
Reference in New Issue