mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Fix handling of timers when cloning TableVals
When cloning TableVals, a new timer was created for the wrong object (the existing TableVal, not the clone). This lead to the already existing timer being no longer accessible. Which, in turn, leads to an abandoned timer reading into no longer allocated data when the original TableVal is deleted. Fixes GH-1687
This commit is contained in:
parent
c58e4ec445
commit
13cfa4c938
2 changed files with 8 additions and 2 deletions
|
@ -2768,8 +2768,8 @@ ValPtr TableVal::DoClone(CloneState* state)
|
|||
|
||||
// As network_time is not necessarily initialized yet, we set
|
||||
// a timer which fires immediately.
|
||||
timer = new TableValTimer(this, 1);
|
||||
detail::timer_mgr->Add(timer);
|
||||
tv->timer = new TableValTimer(tv.get(), 1);
|
||||
detail::timer_mgr->Add(tv->timer);
|
||||
}
|
||||
|
||||
if ( expire_func )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue