From fb0737f3a0a1c377c84d7d0a77601333e908555d Mon Sep 17 00:00:00 2001 From: Paul Saab Date: Tue, 9 Apr 2013 20:40:13 -0700 Subject: [PATCH] ares_parse_aaaa_reply: Plug memory leak This change is similar to ares_parse_a_reply.c in commit bffd67f16a8f42fe6dbf79ab2e39d92eea05c8a6 --- ares_parse_aaaa_reply.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ares_parse_aaaa_reply.c b/ares_parse_aaaa_reply.c index a34a3071..31e4a8c3 100644 --- a/ares_parse_aaaa_reply.c +++ b/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; }