Permalink
Browse files

Do not leak rr_name on failures inside ares_parse_ns_reply

  • Loading branch information...
1 parent 8e457f2 commit 978a929b405421bf53f8daf56451b11e3ee4fc03 @jhrozek jhrozek committed Jun 14, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 ares_parse_ns_reply.c
@@ -103,6 +103,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
if ( aptr + RRFIXEDSZ > abuf + alen )
{
status = ARES_EBADRESP;
+ free(rr_name);
break;
}
rr_type = DNS_RR_TYPE( aptr );
@@ -117,6 +118,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
&len);
if ( status != ARES_SUCCESS )
{
+ free(rr_name);
break;
}

0 comments on commit 978a929

Please sign in to comment.