From: Daniel Stenberg Date: Thu, 8 Aug 2013 14:26:10 +0000 (+0200) Subject: global dns cache: fix memory leak X-Git-Tag: curl-7_32_0~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d20def20462e7;p=thirdparty%2Fcurl.git global dns cache: fix memory leak The take down of the global dns cache didn't take CURLOPT_RESOLVE names into account. --- diff --git a/lib/hostip.c b/lib/hostip.c index c137a19c3b..f37b4925bb 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -140,6 +140,10 @@ struct curl_hash *Curl_global_host_cache_init(void) void Curl_global_host_cache_dtor(void) { if(host_cache_initialized) { + /* first make sure that any custom "CURLOPT_RESOLVE" names are + cleared off */ + Curl_hostcache_clean(NULL, &hostname_cache); + /* then free the remaining hash completely */ Curl_hash_clean(&hostname_cache); host_cache_initialized = 0; }