aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/multi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 5f98c2eaf..c59145414 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -322,6 +322,12 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
if (easy->easy_handle->dns.hostcache &&
(easy->easy_handle->dns.hostcachetype == HCACHE_PRIVATE)) {
Curl_hash_destroy(easy->easy_handle->dns.hostcache);
+ easy->easy_handle->dns.hostcache = NULL;
+ easy->easy_handle->dns.hostcachetype = HCACHE_NONE;
+ }
+
+ if (!easy->easy_handle->dns.hostcache ||
+ (easy->easy_handle->dns.hostcachetype == HCACHE_NONE)) {
easy->easy_handle->dns.hostcache = multi->hostcache;
easy->easy_handle->dns.hostcachetype = HCACHE_MULTI;
}