mirror of
https://github.com/curl/curl.git
synced 2026-04-15 01:11:40 +03: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
1 changed files with 2 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue