Fix memory leak in DNS TXT lookups.

This commit is contained in:
Jon Siwek 2013-09-04 16:47:44 -05:00
parent 6ad82ff263
commit 62de5678f7
2 changed files with 54 additions and 1 deletions

View file

@ -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 )