mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:13:35 +03:00
curl: properly free mimepost data
... as it could otherwise leak memory when a transfer failed. Added test 1293 to verify. Reported-by: Brian Carpenter Fixes #4781 Closes #4782
This commit is contained in:
parent
271ec6b9b6
commit
392bff4abf
3 changed files with 72 additions and 2 deletions
|
|
@ -1357,6 +1357,9 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||
config->postfieldsize);
|
||||
break;
|
||||
case HTTPREQ_MIMEPOST:
|
||||
/* free previous remainders */
|
||||
curl_mime_free(config->mimepost);
|
||||
config->mimepost = NULL;
|
||||
result = tool2curlmime(curl, config->mimeroot, &config->mimepost);
|
||||
if(result)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue