]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
add null-pointer check
authorYang Tse <yangsita@gmail.com>
Mon, 27 Oct 2008 05:29:17 +0000 (05:29 +0000)
committerYang Tse <yangsita@gmail.com>
Mon, 27 Oct 2008 05:29:17 +0000 (05:29 +0000)
lib/hash.c
lib/hostip6.c

index f7d072482e2faf1383178fcbe5f36da4c26e79f3..7757d8b64177cceddc6ef4d11f6406ae17c43b73 100644 (file)
@@ -45,7 +45,8 @@ hash_element_dtor(void *user, void *element)
   if(e->key)
     free(e->key);
 
-  h->dtor(e->ptr);
+  if(e->ptr)
+    h->dtor(e->ptr);
 
   free(e);
 }
index e1c9012124a39ff9243ec1a4a1022f6578baf41a..228352d2634f5bce3672c784991a3c8e350c2119 100644 (file)
@@ -85,7 +85,8 @@
  */
 void Curl_freeaddrinfo(Curl_addrinfo *p)
 {
-  freeaddrinfo(p);
+  if(p)
+    freeaddrinfo(p);
 }
 
 #ifdef CURLRES_ASYNCH