mirror of
https://github.com/curl/curl.git
synced 2026-06-01 19:44:16 +03:00
formdata: Fixed memory leak on OOM condition
This commit is contained in:
parent
e2dae8a7c2
commit
85a4df8b79
1 changed files with 3 additions and 1 deletions
|
|
@ -1110,8 +1110,10 @@ static CURLcode formdata_add_filename(const struct curl_httppost *file,
|
|||
|
||||
/* filename need be escaped */
|
||||
filename_escaped = malloc(strlen(filename)*2+1);
|
||||
if(!filename_escaped)
|
||||
if(!filename_escaped) {
|
||||
free(filebasename);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
p0 = filename_escaped;
|
||||
p1 = filename;
|
||||
while(*p1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue