diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2013-02-10 22:57:58 +0100 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2013-02-10 22:57:58 +0100 |
commit | da3fc1ee91de656a30f3a12de394bcba55119872 (patch) | |
tree | 96272b4c18101155752165f0a5ad68c3fac8aa44 /lib | |
parent | 85a2e9ec820a8d904d4733f1d84007e806409e10 (diff) |
Fix NULL pointer reference when closing an unused multi handle.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/multi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/multi.c b/lib/multi.c index fa0afb9f8..706df2398 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -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); |