mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
iosource/Manager: Do not manage lifetime of pkt_src
Now that dry sources are properly reaped and freed, an offline packet source would be deleted once dry, resulting in GetPktSrc() returning a wild pointer. Don't manage the packet source lifetime and instead free it during Manager destruction.
This commit is contained in:
parent
fcca8670d3
commit
0451a4038c
1 changed files with 4 additions and 1 deletions
|
@ -76,6 +76,9 @@ Manager::~Manager() {
|
|||
|
||||
pkt_dumpers.clear();
|
||||
|
||||
// Was registered without lifetime management.
|
||||
delete pkt_src;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
// There's a bug here with builds on Windows that causes an assertion with debug builds
|
||||
// related to libkqueue returning a zero for the file descriptor. The assert happens
|
||||
|
@ -357,7 +360,7 @@ void Manager::Register(IOSource* src, bool dont_count, bool manage_lifetime) {
|
|||
void Manager::Register(PktSrc* src) {
|
||||
pkt_src = src;
|
||||
|
||||
Register(src, false);
|
||||
Register(src, false, false);
|
||||
|
||||
// Once we know if the source is live or not, adapt the
|
||||
// poll_interval accordingly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue