Fix NULL pointer reference when closing an unused multi handle.

This commit is contained in:
Linus Nielsen Feltzing 2013-02-10 22:57:58 +01:00
parent 85a2e9ec82
commit da3fc1ee91
5 changed files with 91 additions and 4 deletions

View file

@ -1773,10 +1773,12 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
/* Close all the connections in the connection cache */
close_all_connections(multi);
multi->closure_handle->dns.hostcache = multi->hostcache;
Curl_hostcache_clean(multi->closure_handle);
if(multi->closure_handle) {
multi->closure_handle->dns.hostcache = multi->hostcache;
Curl_hostcache_clean(multi->closure_handle);
Curl_close(multi->closure_handle);
Curl_close(multi->closure_handle);
}
multi->closure_handle = NULL;
Curl_hash_destroy(multi->sockhash);