Permalink
Browse files

ares_parse_aaaa_reply: fix memory leak

an allocated buffer was not freed in the successful case.
  • Loading branch information...
1 parent 805c736 commit 50f25d8a4b2d16f4c5e0ef620238688b7a315c7a @bagder bagder committed Oct 2, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 ares_parse_aaaa_reply.c
View
@@ -242,6 +242,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
hostent->h_addr_list[i] = (char *) &addrs[i];
hostent->h_addr_list[naddrs] = NULL;
*host = hostent;
+ free(addrs); /* since it isn't used anymore! */
return ARES_SUCCESS;
}
free(hostent);

0 comments on commit 50f25d8

Please sign in to comment.