From e29f62f0a7034a2a42fb43b913e6576e63a03fe5 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 27 Oct 2008 05:29:17 +0000 Subject: [PATCH] add null-pointer check --- lib/hash.c | 3 ++- lib/hostip6.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/hash.c b/lib/hash.c index f7d072482..7757d8b64 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 e1c901212..228352d26 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