mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Fix memory leak in DNS manager (fixes #777).
This commit is contained in:
parent
52cfec8830
commit
1f7bfbb83c
1 changed files with 2 additions and 5 deletions
|
@ -704,6 +704,7 @@ void DNS_Mgr::AddResult(DNS_Mgr_Request* dr, struct nb_dns_result* r)
|
||||||
if ( dr->ReqHost() )
|
if ( dr->ReqHost() )
|
||||||
{
|
{
|
||||||
new_dm = new DNS_Mapping(dr->ReqHost(), h, ttl);
|
new_dm = new DNS_Mapping(dr->ReqHost(), h, ttl);
|
||||||
|
prev_dm = 0;
|
||||||
|
|
||||||
HostMap::iterator it = host_mappings.find(dr->ReqHost());
|
HostMap::iterator it = host_mappings.find(dr->ReqHost());
|
||||||
if ( it == host_mappings.end() )
|
if ( it == host_mappings.end() )
|
||||||
|
@ -711,15 +712,11 @@ void DNS_Mgr::AddResult(DNS_Mgr_Request* dr, struct nb_dns_result* r)
|
||||||
host_mappings[dr->ReqHost()].first =
|
host_mappings[dr->ReqHost()].first =
|
||||||
new_dm->Type() == AF_INET ? new_dm : 0;
|
new_dm->Type() == AF_INET ? new_dm : 0;
|
||||||
host_mappings[dr->ReqHost()].second =
|
host_mappings[dr->ReqHost()].second =
|
||||||
new_dm->Type() == AF_INET6 ? new_dm : 0;
|
new_dm->Type() == AF_INET ? 0 : new_dm;
|
||||||
|
|
||||||
prev_dm = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
prev_dm = 0;
|
|
||||||
|
|
||||||
if ( new_dm->Type() == AF_INET )
|
if ( new_dm->Type() == AF_INET )
|
||||||
{
|
{
|
||||||
prev_dm = it->second.first;
|
prev_dm = it->second.first;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue