ares_parse_aaaa_reply: Plug memory leak

This change is similar to ares_parse_a_reply.c in commit
bffd67f16a
pull/10/merge
Paul Saab 12 years ago committed by Daniel Stenberg
parent b5135bbc66
commit fb0737f3a0
  1. 2
      ares_parse_aaaa_reply.c

@ -242,6 +242,8 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
for (i = 0; i < naddrs; i++)
hostent->h_addr_list[i] = (char *) &addrs[i];
hostent->h_addr_list[naddrs] = NULL;
if (!naddrs && addrs)
free(addrs);
*host = hostent;
return ARES_SUCCESS;
}

Loading…
Cancel
Save