ares_free_hostent(NULL) should be a noop
authorJakub Hrozek <jhrozek@redhat.com>
Mon, 13 Jun 2011 16:21:08 +0000 (18:21 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 13 Jun 2011 20:47:35 +0000 (22:47 +0200)
ares_free_hostent.c

index b124560d86a1b7522e0de2c7cb59964f1ce16982..349d379af3a0609c259168b1d3cb1b62d8a4c65d 100644 (file)
@@ -28,6 +28,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);