Browse files

ares_free_hostent(NULL) should be a noop

  • Loading branch information...
1 parent e67edcd commit adf75c56c419e23be63de86913e587e502f74c5b @jhrozek jhrozek committed with bagder Jun 13, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 ares_free_hostent.c
View
3 ares_free_hostent.c
@@ -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);

0 comments on commit adf75c5

Please sign in to comment.