mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Fix file analyzer memory management.
File analyzers got deleted immediately once the queue with the corresponding removal operation got drained. That however can happen while the analyzer is still doing stuff: the queue is drained whenever any the "special" file analysis events needing immediate attention has been executed. This fix now only schedules the analyzer for deletion at that time, but postpones the actual operation until file object itself is being destroyed.
This commit is contained in:
parent
572c9b49fd
commit
3ce6a031d4
3 changed files with 18 additions and 1 deletions
|
@ -130,7 +130,10 @@ bool AnalyzerSet::Remove(file_analysis::Tag tag, HashKey* key)
|
|||
file_mgr->GetComponentName(tag).c_str());
|
||||
|
||||
a->Done();
|
||||
delete a;
|
||||
|
||||
// We don't delete the analyze object right here because the remove
|
||||
// operation may execute when that will still be accessed.
|
||||
file->DoneWithAnalyzer(a);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue