mirror of
https://github.com/curl/curl.git
synced 2024-12-27 06:59:43 +08:00
setopt: clear mimepost when formp is freed
A precaution to avoid a possibly dangling pointer left behind. Reported-by: Thomas Ferguson Fixes #12608 Closes #12621
This commit is contained in:
parent
bf7cd837a6
commit
eeda18b1d2
@ -681,6 +681,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
||||
data->set.opt_no_body = FALSE; /* this is implied */
|
||||
Curl_mime_cleanpart(data->state.formp);
|
||||
Curl_safefree(data->state.formp);
|
||||
data->state.mimepost = NULL;
|
||||
break;
|
||||
#endif
|
||||
|
||||
@ -988,6 +989,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
||||
#ifndef CURL_DISABLE_FORM_API
|
||||
Curl_mime_cleanpart(data->state.formp);
|
||||
Curl_safefree(data->state.formp);
|
||||
data->state.mimepost = NULL;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user