mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
mark a value as alloced when strdup()ed to prevent memory leaks
This commit is contained in:
parent
b121e41ec3
commit
ccdcdb2a46
@ -492,8 +492,10 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||||||
current_form->value = strdup(filename);
|
current_form->value = strdup(filename);
|
||||||
if(!current_form->value)
|
if(!current_form->value)
|
||||||
return_value = CURL_FORMADD_MEMORY;
|
return_value = CURL_FORMADD_MEMORY;
|
||||||
else
|
else {
|
||||||
current_form->flags |= HTTPPOST_READFILE;
|
current_form->flags |= HTTPPOST_READFILE;
|
||||||
|
current_form->value_alloc = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return_value = CURL_FORMADD_NULL;
|
return_value = CURL_FORMADD_NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user