Permalink
Browse files

Do not leak rr_name on failures inside ares_parse_aaaa_reply

  • Loading branch information...
1 parent 978a929 commit 18b6d475dc160efba24861e584dd6de92a573862 @jhrozek jhrozek committed Jun 14, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 ares_parse_aaaa_reply.c
View
@@ -132,6 +132,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
aptr += len;
if (aptr + RRFIXEDSZ > abuf + alen)
{
+ free(rr_name);
status = ARES_EBADRESP;
break;
}
@@ -149,6 +150,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
{
if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
{
+ free(rr_name);
status = ARES_EBADRESP;
break;
}
@@ -159,6 +161,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
struct ares_addr6ttl * const at = &addrttls[naddrs];
if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
{
+ free(rr_name);
status = ARES_EBADRESP;
break;
}

0 comments on commit 18b6d47

Please sign in to comment.