]> granicus.if.org Git - curl/commitdiff
better bailing-out cleanup if a malloc fails in the DNS cache
authorDaniel Stenberg <daniel@haxx.se>
Fri, 24 Oct 2003 12:57:23 +0000 (12:57 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 24 Oct 2003 12:57:23 +0000 (12:57 +0000)
lib/hostip.c

index c06961e7907334c33eeaede9d301bbf9622d2308..21227567e2bf13329784740bf74e7475c6367ee5 100644 (file)
@@ -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);
+      }
     }
   }