Skip to content
Snippets Groups Projects
Commit cfe53768 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

if Curl_hash_add() returns NULL, we shall not free the addrinfo field as that

is made in the hash function in the case of failure (using the already setup
'dtor' function).
parent 947e6563
No related branches found
No related tags found
No related merge requests found
......@@ -237,10 +237,10 @@ cache_resolv_response(struct SessionHandle *data,
/* Store the resolved data in our DNS cache. This function may return a
pointer to an existing struct already present in the hash, and it may
return the same argument we pass in. Make no assumptions. */
dns = Curl_hash_add(data->hostcache, entry_id, entry_len+1, (void *) dns);
dns = Curl_hash_add(data->hostcache, entry_id, entry_len+1, (void *)dns);
if(!dns) {
/* major badness, run away! */
Curl_freeaddrinfo(addr);
/* Major badness, run away. When this happens, the 'dns' data has
already been cleared up by Curl_hash_add(). */
free(entry_id);
return NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment