transfer.c: fix loadhostpairs() OOM handling
authorYang Tse <yangsita@gmail.com>
Thu, 1 Sep 2011 22:06:19 +0000 (00:06 +0200)
committerYang Tse <yangsita@gmail.com>
Thu, 1 Sep 2011 22:06:19 +0000 (00:06 +0200)
lib/transfer.c

index 2f4b69c..def0e6a 100644 (file)
@@ -1437,8 +1437,10 @@ static CURLcode loadhostpairs(struct SessionHandle *data)
       if(data->share)
         Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
 
-      if(!dns)
+      if(!dns) {
+        Curl_freeaddrinfo(addr);
         return CURLE_OUT_OF_MEMORY;
+      }
     }
   }
   data->change.resolve = NULL; /* dealt with now */