From: Yang Tse Date: Mon, 27 Oct 2008 05:29:17 +0000 (+0000) Subject: add null-pointer check X-Git-Tag: curl-7_19_1~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e29f62f0a7034a2a42fb43b913e6576e63a03fe5;p=thirdparty%2Fcurl.git add null-pointer check --- diff --git a/lib/hash.c b/lib/hash.c index f7d072482e..7757d8b641 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -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); } diff --git a/lib/hostip6.c b/lib/hostip6.c index e1c9012124..228352d263 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -85,7 +85,8 @@ */ void Curl_freeaddrinfo(Curl_addrinfo *p) { - freeaddrinfo(p); + if(p) + freeaddrinfo(p); } #ifdef CURLRES_ASYNCH