diff --git a/lib/multi.c b/lib/multi.c index 52eeb7f9f28aaaeb0baff4cd9c2e44505554e7a3..6834e68e1b4656414d096c8ad32d6cb32302064e 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;