mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Scope: lookup_ID() and install_ID() return IntrusivePtr<ID>
This fixes several memory leaks and double free bugs.
This commit is contained in:
parent
cbb6f09726
commit
528cf11a5c
14 changed files with 60 additions and 100 deletions
|
@ -38,8 +38,8 @@ FuncType* EventHandler::FType(bool check_export)
|
|||
if ( type )
|
||||
return type;
|
||||
|
||||
ID* id = lookup_ID(name, current_module.c_str(), false, false,
|
||||
check_export);
|
||||
auto id = lookup_ID(name, current_module.c_str(), false, false,
|
||||
check_export);
|
||||
|
||||
if ( ! id )
|
||||
return 0;
|
||||
|
@ -48,8 +48,6 @@ FuncType* EventHandler::FType(bool check_export)
|
|||
return 0;
|
||||
|
||||
type = id->Type()->AsFuncType();
|
||||
Unref(id);
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue