OOM condition fix
authorYang Tse <yangsita@gmail.com>
Fri, 17 Oct 2008 12:49:02 +0000 (12:49 +0000)
committerYang Tse <yangsita@gmail.com>
Fri, 17 Oct 2008 12:49:02 +0000 (12:49 +0000)
lib/hostip.c

index 2fd99ef..95029e6 100644 (file)
@@ -928,8 +928,10 @@ Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
     prevai = ai;
   }
 
-  if(result != CURLE_OK)
+  if(result != CURLE_OK) {
     Curl_freeaddrinfo(firstai);
+    firstai = NULL;
+  }
 
   return firstai;
 }