From 0e5ae22f7323e30d1b266e4266cad554517c2bd0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 16 May 2012 23:28:07 +0900 Subject: [PATCH] Fixed memory leak --- test/AsyncNameResolverTest.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/AsyncNameResolverTest.cc b/test/AsyncNameResolverTest.cc index 1f60b7e4..76045853 100644 --- a/test/AsyncNameResolverTest.cc +++ b/test/AsyncNameResolverTest.cc @@ -42,6 +42,11 @@ void AsyncNameResolverTest::testParseAsyncDNSServers() CPPUNIT_ASSERT(node); CPPUNIT_ASSERT_EQUAL(AF_INET6, node->family); CPPUNIT_ASSERT(memcmp(&ans6, &node->addr, sizeof(ans6)) == 0); + for(node = root; node;) { + ares_addr_node* nextNode = node->next; + delete node; + node = nextNode; + } #endif // HAVE_ARES_ADDR_NODE }