ares.h: there is no ares_free_soa function
[platform/upstream/c-ares.git] / ares_free_hostent.c
index b124560..7f44882 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include "ares_setup.h"
-#include <stdlib.h>
 
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
@@ -28,6 +27,9 @@ void ares_free_hostent(struct hostent *host)
 {
   char **p;
 
+  if (!host)
+    return;
+
   free((char *)(host->h_name));
   for (p = host->h_aliases; *p; p++)
     free(*p);