Fixing DNS memory leaks.

Some of the changes only clean up at termination to make perftools
happt, but there were some "real" leaks as well.

This fixes all DNS leaks I could reproducem, including most likely
what's reported in #534. Closing #534.

I'm also adding a new btest subdir core/leaks with tests requiring
perftools support. These don't compare against base lines but abort
whenever perftools reports a leak (with stack information to track it
down). Right now, these are passing.
This commit is contained in:
Robin Sommer 2011-10-08 18:54:58 -07:00
parent 8627b87b3e
commit bd9c937236
10 changed files with 113 additions and 8 deletions

View file

@ -1463,6 +1463,7 @@ TableVal* ListVal::ConvertToSet() const
loop_over_list(vals, i)
t->Assign(vals[i], 0);
Unref(s);
return t;
}
@ -1582,6 +1583,7 @@ TableVal::TableVal(TableType* t, Attributes* a) : MutableVal(t)
void TableVal::Init(TableType* t)
{
::Ref(t);
table_type = t;
expire_expr = 0;
expire_time = 0;
@ -1604,6 +1606,7 @@ TableVal::~TableVal()
if ( timer )
timer_mgr->Cancel(timer);
Unref(table_type);
delete table_hash;
delete AsTable();
delete subnets;