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 b11df524952eb3b81e3ad48aab784497606aa96e..c5c1ebfb865a3ef7a3e18acbfeeda9a1815a2b41 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);