Loading ares/ares__get_hostent.c +9 −5 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ int ares__get_hostent(FILE *fp, struct hostent **host) memcpy(hostent->h_addr_list[0], &addr, sizeof(struct in_addr)); hostent->h_addr_list[1] = NULL; *host = hostent; if(line) free(line); return ARES_SUCCESS; } Loading @@ -150,18 +151,21 @@ int ares__get_hostent(FILE *fp, struct hostent **host) /* Memory allocation failure; clean up. */ if (hostent) { if(hostent->h_name) free((char *) hostent->h_name); if (hostent->h_aliases) { for (alias = hostent->h_aliases; *alias; alias++) free(*alias); } if(hostent->h_aliases) free(hostent->h_aliases); if (hostent->h_addr_list) free(hostent->h_addr_list[0]); if(hostent->h_addr_list) free(hostent->h_addr_list); } free(hostent); } return ARES_ENOMEM; } Loading Loading
ares/ares__get_hostent.c +9 −5 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ int ares__get_hostent(FILE *fp, struct hostent **host) memcpy(hostent->h_addr_list[0], &addr, sizeof(struct in_addr)); hostent->h_addr_list[1] = NULL; *host = hostent; if(line) free(line); return ARES_SUCCESS; } Loading @@ -150,18 +151,21 @@ int ares__get_hostent(FILE *fp, struct hostent **host) /* Memory allocation failure; clean up. */ if (hostent) { if(hostent->h_name) free((char *) hostent->h_name); if (hostent->h_aliases) { for (alias = hostent->h_aliases; *alias; alias++) free(*alias); } if(hostent->h_aliases) free(hostent->h_aliases); if (hostent->h_addr_list) free(hostent->h_addr_list[0]); if(hostent->h_addr_list) free(hostent->h_addr_list); } free(hostent); } return ARES_ENOMEM; } Loading