mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Fix memory leak in DNS TXT lookups.
This commit is contained in:
parent
6ad82ff263
commit
62de5678f7
2 changed files with 54 additions and 1 deletions
|
@ -713,6 +713,16 @@ void DNS_Mgr::AddResult(DNS_Mgr_Request* dr, struct nb_dns_result* r)
|
|||
TextMap::iterator it = text_mappings.find(dr->ReqHost());
|
||||
if ( it == text_mappings.end() )
|
||||
text_mappings[dr->ReqHost()] = new_dm;
|
||||
else
|
||||
{
|
||||
if ( new_dm->Failed() && prev_dm && prev_dm->Valid() )
|
||||
++keep_prev;
|
||||
else
|
||||
{
|
||||
prev_dm = it->second;
|
||||
it->second = new_dm;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -766,7 +776,7 @@ void DNS_Mgr::AddResult(DNS_Mgr_Request* dr, struct nb_dns_result* r)
|
|||
}
|
||||
}
|
||||
|
||||
if ( prev_dm )
|
||||
if ( prev_dm && ! dr->ReqIsTxt() )
|
||||
CompareMappings(prev_dm, new_dm);
|
||||
|
||||
if ( keep_prev )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue