Skip to content

Commit

Permalink
Do not leak rr_name on failures inside ares_parse_a_reply
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrozek committed Jun 14, 2011
1 parent 18b6d47 commit a111672
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ares_parse_a_reply.c
Expand Up @@ -132,6 +132,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
aptr += len;
if (aptr + RRFIXEDSZ > abuf + alen)
{
free(rr_name);
status = ARES_EBADRESP;
break;
}
Expand All @@ -149,6 +150,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
{
if (aptr + sizeof(struct in_addr) > abuf + alen)
{
free(rr_name);
status = ARES_EBADRESP;
break;
}
Expand All @@ -159,6 +161,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
struct ares_addrttl * const at = &addrttls[naddrs];
if (aptr + sizeof(struct in_addr) > abuf + alen)
{
free(rr_name);
status = ARES_EBADRESP;
break;
}
Expand Down

0 comments on commit a111672

Please sign in to comment.