ares_parse_aaaa_reply: fix memory leak
authorDaniel Stenberg <daniel@haxx.se>
Tue, 2 Oct 2012 20:36:05 +0000 (22:36 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 2 Oct 2012 20:36:05 +0000 (22:36 +0200)
an allocated buffer was not freed in the successful case.

ares_parse_aaaa_reply.c

index b11df52..c5c1ebf 100644 (file)
@@ -242,6 +242,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
                     hostent->h_addr_list[i] = (char *) &addrs[i];
                   hostent->h_addr_list[naddrs] = NULL;
                   *host = hostent;
+                  free(addrs); /* since it isn't used anymore! */
                   return ARES_SUCCESS;
                 }
               free(hostent);