diff options
Diffstat (limited to 'Source/CTest/Curl/easy.c')
-rw-r--r-- | Source/CTest/Curl/easy.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/CTest/Curl/easy.c b/Source/CTest/Curl/easy.c index b128180..145db5a 100644 --- a/Source/CTest/Curl/easy.c +++ b/Source/CTest/Curl/easy.c @@ -233,15 +233,17 @@ CURLcode curl_easy_perform(CURL *curl) { struct SessionHandle *data = (struct SessionHandle *)curl; - if (!data->hostcache) { - if (Curl_global_host_cache_use(data)) { - data->hostcache = Curl_global_host_cache_get(); - } - else { - data->hostcache = Curl_hash_alloc(7, Curl_freeaddrinfo); + if (Curl_global_host_cache_use(data) && data->hostcache != Curl_global_host_cache_get()) { + if (data->hostcache) { + Curl_hash_destroy(data->hostcache); } + data->hostcache = Curl_global_host_cache_get(); } + if (!data->hostcache) { + data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo); + } + return Curl_perform(data); } |