Lines Matching refs:res
45 struct hostent *res; in copyhostent() local
49 res = malloc (sizeof (*res)); in copyhostent()
50 if (res == NULL) in copyhostent()
52 res->h_name = NULL; in copyhostent()
53 res->h_aliases = NULL; in copyhostent()
54 res->h_addrtype = h->h_addrtype; in copyhostent()
55 res->h_length = h->h_length; in copyhostent()
56 res->h_addr_list = NULL; in copyhostent()
57 res->h_name = strdup (h->h_name); in copyhostent()
58 if (res->h_name == NULL) { in copyhostent()
59 freehostent (res); in copyhostent()
64 res->h_aliases = malloc ((n + 1) * sizeof(*res->h_aliases)); in copyhostent()
65 if (res->h_aliases == NULL) { in copyhostent()
66 freehostent (res); in copyhostent()
70 res->h_aliases[i] = NULL; in copyhostent()
72 res->h_aliases[i] = strdup (h->h_aliases[i]); in copyhostent()
73 if (res->h_aliases[i] == NULL) { in copyhostent()
74 freehostent (res); in copyhostent()
81 res->h_addr_list = malloc ((n + 1) * sizeof(*res->h_addr_list)); in copyhostent()
82 if (res->h_addr_list == NULL) { in copyhostent()
83 freehostent (res); in copyhostent()
87 res->h_addr_list[i] = NULL; in copyhostent()
90 res->h_addr_list[i] = malloc (h->h_length); in copyhostent()
91 if (res->h_addr_list[i] == NULL) { in copyhostent()
92 freehostent (res); in copyhostent()
95 memcpy (res->h_addr_list[i], h->h_addr_list[i], h->h_length); in copyhostent()
97 return res; in copyhostent()