From 978a929b405421bf53f8daf56451b11e3ee4fc03 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 14 Jun 2011 16:40:07 +0200 Subject: [PATCH] Do not leak rr_name on failures inside ares_parse_ns_reply --- ares_parse_ns_reply.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ares_parse_ns_reply.c b/ares_parse_ns_reply.c index 73ab74c..5e9af71 100644 --- a/ares_parse_ns_reply.c +++ b/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; }