From: Yang Tse Date: Tue, 25 Dec 2012 12:31:26 +0000 (+0100) Subject: curl_multi_remove_handle: fix memory leak triggered with CURLOPT_RESOLVE X-Git-Tag: curl-7_29_0~187 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0aabfd9963;p=thirdparty%2Fcurl.git curl_multi_remove_handle: fix memory leak triggered with CURLOPT_RESOLVE --- diff --git a/lib/multi.c b/lib/multi.c index 52eeb7f9f2..6834e68e1b 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -649,6 +649,10 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle, } if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) { + if(multi->num_easy == 1) { + Curl_hostcache_destroy(easy->easy_handle); + multi->hostcache = NULL; + } /* clear out the usage of the shared DNS cache */ easy->easy_handle->dns.hostcache = NULL; easy->easy_handle->dns.hostcachetype = HCACHE_NONE;