mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
multi.c: OOM handling fix
Fix curl_multi_cleanup() segfault when using weird cleanup sequence.
This commit is contained in:
parent
b0d42da26b
commit
ddeab48245
10
lib/multi.c
10
lib/multi.c
@ -1775,10 +1775,6 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
|
||||
|
||||
if(GOOD_MULTI_HANDLE(multi)) {
|
||||
multi->type = 0; /* not good anymore */
|
||||
Curl_hash_destroy(multi->hostcache);
|
||||
Curl_hash_destroy(multi->sockhash);
|
||||
multi->hostcache = NULL;
|
||||
multi->sockhash = NULL;
|
||||
|
||||
/* go over all connections that have close actions */
|
||||
for(i=0; i< multi->connc->num; i++) {
|
||||
@ -1802,6 +1798,12 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
|
||||
cl= n;
|
||||
}
|
||||
|
||||
Curl_hash_destroy(multi->hostcache);
|
||||
multi->hostcache = NULL;
|
||||
|
||||
Curl_hash_destroy(multi->sockhash);
|
||||
multi->sockhash = NULL;
|
||||
|
||||
Curl_rm_connc(multi->connc);
|
||||
multi->connc = NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user