Support Watt-32 under Win32.
[platform/upstream/c-ares.git] / ares_free_hostent.c
index a41624f..d766795 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: */
+/* $Id$ */
 
 /* Copyright 1998 by the Massachusetts Institute of Technology.
  *
@@ -29,11 +29,12 @@ void ares_free_hostent(struct hostent *host)
 {
   char **p;
 
-  free(host->h_name);
+  free((char *)(host->h_name));
   for (p = host->h_aliases; *p; p++)
     free(*p);
   free(host->h_aliases);
-  free(host->h_addr_list[0]);
+  free(host->h_addr_list[0]); /* no matter if there is one or many entries,
+                                 there is only one malloc for all of them */
   free(host->h_addr_list);
   free(host);
 }