From 0aabfd99631a292a72ca601ed0e83786ce9f0ae4 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 25 Dec 2012 13:31:26 +0100 Subject: curl_multi_remove_handle: fix memory leak triggered with CURLOPT_RESOLVE --- lib/multi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/multi.c') diff --git a/lib/multi.c b/lib/multi.c index 52eeb7f9f..6834e68e1 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; -- cgit v1.2.3