add null-pointer check

This commit is contained in:
Yang Tse 2008-10-27 05:29:17 +00:00
parent 39e5fa6ae8
commit e29f62f0a7
2 changed files with 4 additions and 2 deletions

View 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);
}

View File

@ -85,7 +85,8 @@
*/
void Curl_freeaddrinfo(Curl_addrinfo *p)
{
freeaddrinfo(p);
if(p)
freeaddrinfo(p);
}
#ifdef CURLRES_ASYNCH