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
bd9c937236, 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.
This commit is contained in:
Jon Siwek 2011-11-30 13:31:54 -06:00
parent 95ca102546
commit 4444c56a94
2 changed files with 4 additions and 2 deletions

View file

@ -595,8 +595,6 @@ void DNS_Mgr::Resolve()
} }
else else
--num_pending; --num_pending;
delete dr;
} }
} }

View file

@ -4,6 +4,10 @@
# #
# @TEST-EXEC: HEAP_CHECK_DUMP_DIRECTORY=. HEAPCHECK=local bro -m -r $TRACES/wikipedia.trace %INPUT # @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 # Add the state tracking information variable to the connection record
event connection_established(c: connection) event connection_established(c: connection)