zz40-xc-ovr.m4: fix variable assignment of subshell output bashism
[platform/upstream/c-ares.git] / ares_parse_ns_reply.c
index a7f4543..553f253 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id */
-
 /* Copyright 1998 by the Massachusetts Institute of Technology.
  *
  * Permission to use, copy, modify, and distribute this
  *      on behalf of AVIRA Gmbh - http://www.avira.com
  */
 
-#include "setup.h"
+#include "ares_setup.h"
 
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
 #ifdef HAVE_NETINET_IN_H
 #  include <netinet/in.h>
 #endif
@@ -43,8 +38,6 @@
 #  include <arpa/nameser_compat.h>
 #endif
 
-#include <stdlib.h>
-#include <string.h>
 #include "ares.h"
 #include "ares_dns.h"
 #include "ares_private.h"
@@ -105,6 +98,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 );
@@ -119,6 +113,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
                                                &len);
       if ( status != ARES_SUCCESS )
       {
+        free(rr_name);
         break;
       }