"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/ares_free_hostent.c" between
c-ares-1.17.1.tar.gz and c-ares-1.17.2.tar.gz

About: c-ares is a C library for asynchronous DNS requests (including name resolves).

ares_free_hostent.c  (c-ares-1.17.1):ares_free_hostent.c  (c-ares-1.17.2)
skipping to change at line 34 skipping to change at line 34
#include "ares_private.h" /* for memdebug */ #include "ares_private.h" /* for memdebug */
void ares_free_hostent(struct hostent *host) void ares_free_hostent(struct hostent *host)
{ {
char **p; char **p;
if (!host) if (!host)
return; return;
ares_free((char *)(host->h_name)); ares_free((char *)(host->h_name));
for (p = host->h_aliases; *p; p++) for (p = host->h_aliases; p && *p; p++)
ares_free(*p); ares_free(*p);
ares_free(host->h_aliases); ares_free(host->h_aliases);
ares_free(host->h_addr_list[0]); /* no matter if there is one or many entries, if (host->h_addr_list) {
there is only one malloc for all of them */ ares_free(host->h_addr_list[0]); /* no matter if there is one or many entrie
ares_free(host->h_addr_list); s,
there is only one malloc for all of them */
ares_free(host->h_addr_list);
}
ares_free(host); ares_free(host);
} }
 End of changes. 2 change blocks. 
4 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)