Lines Matching refs:hostent
48 int addrlen, int family, struct hostent **host) in ares_parse_ptr_reply()
55 struct hostent *hostent; in ares_parse_ptr_reply() local
175 hostent = malloc(sizeof(struct hostent)); in ares_parse_ptr_reply()
176 if (hostent) in ares_parse_ptr_reply()
178 hostent->h_addr_list = malloc(2 * sizeof(char *)); in ares_parse_ptr_reply()
179 if (hostent->h_addr_list) in ares_parse_ptr_reply()
181 hostent->h_addr_list[0] = malloc(addrlen); in ares_parse_ptr_reply()
182 if (hostent->h_addr_list[0]) in ares_parse_ptr_reply()
184 hostent->h_aliases = malloc((aliascnt+1) * sizeof (char *)); in ares_parse_ptr_reply()
185 if (hostent->h_aliases) in ares_parse_ptr_reply()
188 hostent->h_name = hostname; in ares_parse_ptr_reply()
190 hostent->h_aliases[i] = aliases[i]; in ares_parse_ptr_reply()
191 hostent->h_aliases[aliascnt] = NULL; in ares_parse_ptr_reply()
192 hostent->h_addrtype = family; in ares_parse_ptr_reply()
193 hostent->h_length = addrlen; in ares_parse_ptr_reply()
194 memcpy(hostent->h_addr_list[0], addr, addrlen); in ares_parse_ptr_reply()
195 hostent->h_addr_list[1] = NULL; in ares_parse_ptr_reply()
196 *host = hostent; in ares_parse_ptr_reply()
201 free(hostent->h_addr_list[0]); in ares_parse_ptr_reply()
203 free(hostent->h_addr_list); in ares_parse_ptr_reply()
205 free(hostent); in ares_parse_ptr_reply()