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:
Jon Siwek 2021-03-05 17:28:05 -08:00
commit ff90236df3
10 changed files with 66 additions and 29 deletions

View file

@ -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.
*