summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Saab <ps@fb.com>2013-04-09 20:40:13 -0700
committerDaniel Stenberg <daniel@haxx.se>2013-04-22 23:54:40 +0200
commitfb0737f3a0a1c377c84d7d0a77601333e908555d (patch)
treeb4e0759687a2779fe895a0018da0127150a36e61
parentb5135bbc66cf6f0a884937a9eccc61ac795b1ee0 (diff)
downloadc-ares-fb0737f3a0a1c377c84d7d0a77601333e908555d.tar.gz
c-ares-fb0737f3a0a1c377c84d7d0a77601333e908555d.tar.bz2
c-ares-fb0737f3a0a1c377c84d7d0a77601333e908555d.zip
ares_parse_aaaa_reply: Plug memory leak
This change is similar to ares_parse_a_reply.c in commit bffd67f16a8f42fe6dbf79ab2e39d92eea05c8a6
-rw-r--r--ares_parse_aaaa_reply.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ares_parse_aaaa_reply.c b/ares_parse_aaaa_reply.c
index a34a307..31e4a8c 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;
}