aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
+ }
}
}