From 4444c56a9494fc3e38c1d39ae7d0d0fc812b5b8f Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Wed, 30 Nov 2011 13:31:54 -0600 Subject: [PATCH] Fix double-free of DNS_Mgr_Request object (addresses #661) In DNS::Resolve, they could be deleted once from where they were stored in the nb_dns_info cookie and once again from where they were stored in the DNS_Mgr::requests list. Before commit bd9c9372368f547d0930932de0995f50762b501c, they were only deleted from the requests list, so this commit reverts to that behavior without any leaks being reported by the core/leaks tests. --- src/DNS_Mgr.cc | 2 -- testing/btest/core/leaks/dns.bro | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/DNS_Mgr.cc b/src/DNS_Mgr.cc index 736c262222..2b9d07a969 100644 --- a/src/DNS_Mgr.cc +++ b/src/DNS_Mgr.cc @@ -595,8 +595,6 @@ void DNS_Mgr::Resolve() } else --num_pending; - - delete dr; } } diff --git a/testing/btest/core/leaks/dns.bro b/testing/btest/core/leaks/dns.bro index 1dce9c2c82..3d3fdc6f09 100644 --- a/testing/btest/core/leaks/dns.bro +++ b/testing/btest/core/leaks/dns.bro @@ -4,6 +4,10 @@ # # @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local bro -m -r $TRACES/wikipedia.trace %INPUT +const foo: set[addr] = { + google.com +}; + # Add the state tracking information variable to the connection record event connection_established(c: connection)