summaryrefslogtreecommitdiff
path: root/lib/hostip.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-10-24 12:57:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-10-24 12:57:23 +0000
commit017a78d0c50e2e049c2111065e9c5d4e1e49e533 (patch)
tree9058e50c275edac71776721c26023d9960f7cf5b /lib/hostip.c
parent9010bd3831adffe1c468275f6c627a0e0ce2bd72 (diff)
downloadcurl-017a78d0c50e2e049c2111065e9c5d4e1e49e533.tar.gz
better bailing-out cleanup if a malloc fails in the DNS cache
Diffstat (limited to 'lib/hostip.c')
-rw-r--r--lib/hostip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index c06961e79..21227567e 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -344,6 +344,11 @@ int Curl_resolv(struct connectdata *conn,
if(data->share)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
+
+ if(!dns) {
+ /* returned failure, bail out nicely */
+ Curl_freeaddrinfo(addr);
+ }
}
}