mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
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:
parent
d656e2a8c4
commit
8697615b81
2 changed files with 8 additions and 0 deletions
|
@ -276,6 +276,8 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
||||||
{
|
{
|
||||||
// Can only happen for events.
|
// Can only happen for events.
|
||||||
assert(IsEvent());
|
assert(IsEvent());
|
||||||
|
loop_over_list(*args, i)
|
||||||
|
Unref((*args)[i]);
|
||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,12 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
fprintf(out, "%s", s.c_str());
|
fprintf(out, "%s", s.c_str());
|
||||||
|
|
||||||
|
if ( addl )
|
||||||
|
{
|
||||||
|
loop_over_list(*addl, i)
|
||||||
|
Unref((*addl)[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( alloced )
|
if ( alloced )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue