Do not leak rr_name on failures inside ares_parse_ns_reply
authorJakub Hrozek <jhrozek@redhat.com>
Tue, 14 Jun 2011 14:40:07 +0000 (16:40 +0200)
committerJakub Hrozek <jhrozek@redhat.com>
Tue, 14 Jun 2011 14:41:29 +0000 (16:41 +0200)
ares_parse_ns_reply.c

index 73ab74cac27050e90ecf667c9201adfeb90e8bc3..5e9af71d1a9676f1d81992151f3eb3abe95ecbb3 100644 (file)
@@ -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;
       }