From 017a78d0c50e2e049c2111065e9c5d4e1e49e533 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 24 Oct 2003 12:57:23 +0000 Subject: better bailing-out cleanup if a malloc fails in the DNS cache --- lib/hostip.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/hostip.c') 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); + } } } -- cgit v1.2.3