mirror of
https://github.com/curl/curl.git
synced 2025-03-25 15:50:32 +08:00
duphandle: also free 'outcurl->cookies' in error path
Fixes memory-leak when OOM mid-function Use plain free instead of safefree, since the entire struct is freed below. Remove some free calls that is already freed in Curl_freeset() Closes #12329
This commit is contained in:
parent
6608f34f56
commit
d1820768cc
@ -985,13 +985,10 @@ fail:
|
||||
|
||||
if(outcurl) {
|
||||
#ifndef CURL_DISABLE_COOKIES
|
||||
curl_slist_free_all(outcurl->state.cookielist);
|
||||
outcurl->state.cookielist = NULL;
|
||||
free(outcurl->cookies);
|
||||
#endif
|
||||
Curl_safefree(outcurl->state.buffer);
|
||||
free(outcurl->state.buffer);
|
||||
Curl_dyn_free(&outcurl->state.headerb);
|
||||
Curl_safefree(outcurl->state.url);
|
||||
Curl_safefree(outcurl->state.referer);
|
||||
Curl_altsvc_cleanup(&outcurl->asi);
|
||||
Curl_hsts_cleanup(&outcurl->hsts);
|
||||
Curl_freeset(outcurl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user