mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
Merge remote-tracking branch 'origin/topic/timw/lgtm'
- Fixed leak in threading::Field copy-assignment operator * origin/topic/timw/lgtm: Use const-reference in plugin::Manager::MetaHookPost for minor performance gain Fix missing assigmnent operator/copy constructor pairings reported by LGTM Fix variable shadowing issues reported by LGTM Update binpac and broker submodules to fix LGTM findings
This commit is contained in:
commit
ff90236df3
10 changed files with 66 additions and 29 deletions
|
@ -47,6 +47,22 @@ struct Field {
|
|||
delete [] secondary_name;
|
||||
}
|
||||
|
||||
Field& operator=(const Field& other)
|
||||
{
|
||||
if ( this != &other )
|
||||
{
|
||||
delete [] name;
|
||||
delete [] secondary_name;
|
||||
name = other.name ? util::copy_string(other.name) : nullptr;
|
||||
secondary_name = other.secondary_name ? util::copy_string(other.secondary_name) : nullptr;
|
||||
type = other.type;
|
||||
subtype = other.subtype;
|
||||
optional = other.optional;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unserializes a field.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue