Memory leak fixes.

Both related to Val lists constructed as arguments to events that were
not freed because the event function was never called (e.g. no handlers).

Addresses #574
This commit is contained in:
Jon Siwek 2011-09-15 16:08:48 -05:00
parent d656e2a8c4
commit 8697615b81
2 changed files with 8 additions and 0 deletions

View file

@ -276,6 +276,8 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
{
// Can only happen for events.
assert(IsEvent());
loop_over_list(*args, i)
Unref((*args)[i]);
return 0 ;
}

View file

@ -303,6 +303,12 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
s += "\n";
fprintf(out, "%s", s.c_str());
if ( addl )
{
loop_over_list(*addl, i)
Unref((*addl)[i]);
}
}
if ( alloced )