aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-12-15 15:22:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-12-15 15:22:10 +0000
commitcfe53768dd225eb77e545f58321ca6528287c252 (patch)
tree53db016fd68fa19ced51d10bf1568a205bb18f60 /lib
parent947e6563674b5318b909189168a9640114d8f7ba (diff)
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).
Diffstat (limited to 'lib')
-rw-r--r--lib/hostip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 114525c3d..f2fa350d0 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -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;
}