mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix possible memory leak in broker::Manager
This commit is contained in:
parent
54c5a470bd
commit
ff7c908460
1 changed files with 3 additions and 1 deletions
|
@ -2094,13 +2094,15 @@ detail::StoreHandleVal* Manager::MakeClone(const string& name, double resync_int
|
||||||
}
|
}
|
||||||
|
|
||||||
auto handle = new detail::StoreHandleVal{*result};
|
auto handle = new detail::StoreHandleVal{*result};
|
||||||
Ref(handle);
|
|
||||||
|
|
||||||
if ( ! handle->proxy.valid() ) {
|
if ( ! handle->proxy.valid() ) {
|
||||||
reporter->Error("Failed to create clone for data store %s", name.c_str());
|
reporter->Error("Failed to create clone for data store %s", name.c_str());
|
||||||
|
delete handle;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ref(handle);
|
||||||
|
|
||||||
data_stores.emplace(name, handle);
|
data_stores.emplace(name, handle);
|
||||||
if ( ! iosource_mgr->RegisterFd(handle->proxy.mailbox().descriptor(), this) )
|
if ( ! iosource_mgr->RegisterFd(handle->proxy.mailbox().descriptor(), this) )
|
||||||
reporter->FatalError("Failed to register broker clone mailbox descriptor with iosource_mgr");
|
reporter->FatalError("Failed to register broker clone mailbox descriptor with iosource_mgr");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue