mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
Fix some Coverity warnings.
This commit is contained in:
parent
a273143e7d
commit
3adad5e19a
7 changed files with 27 additions and 8 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
|||
|
||||
2.4-737 | 2016-08-02 11:38:07 -0700
|
||||
|
||||
* Fix some Coverity warnings. (Robin Sommer)
|
||||
|
||||
2.4-735 | 2016-08-02 11:05:36 -0700
|
||||
|
||||
* Added string slicing examples to documentation. (Moshe Kaplan)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.4-735
|
||||
2.4-737
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8dbf2470eda8f358ea225234e05b406da8e258f1
|
||||
Subproject commit 3664242a218c21100d62917866d6b8cb0d6f0fa1
|
14
src/Tag.cc
14
src/Tag.cc
|
@ -65,6 +65,20 @@ Tag& Tag::operator=(const Tag& other)
|
|||
return *this;
|
||||
}
|
||||
|
||||
Tag& Tag::operator=(const Tag&& other)
|
||||
{
|
||||
if ( this != &other )
|
||||
{
|
||||
type = other.type;
|
||||
subtype = other.subtype;
|
||||
Unref(val);
|
||||
val = other.val;
|
||||
other.val = nullptr;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
EnumVal* Tag::AsEnumVal(EnumType* etype) const
|
||||
{
|
||||
if ( ! val )
|
||||
|
|
|
@ -77,6 +77,11 @@ protected:
|
|||
*/
|
||||
Tag& operator=(const Tag& other);
|
||||
|
||||
/**
|
||||
* Move assignment operator.
|
||||
*/
|
||||
Tag& operator=(const Tag&& other);
|
||||
|
||||
/**
|
||||
* Compares two tags for equality.
|
||||
*/
|
||||
|
|
|
@ -2278,7 +2278,7 @@ double TableVal::GetExpireTime()
|
|||
Unref(timeout);
|
||||
|
||||
if ( interval >= 0 )
|
||||
return timeout->AsInterval();
|
||||
return interval;
|
||||
|
||||
expire_time = 0;
|
||||
|
||||
|
@ -2327,6 +2327,7 @@ double TableVal::CallExpireFunc(Val* idx)
|
|||
if ( vf->Type()->Tag() != TYPE_FUNC )
|
||||
{
|
||||
Unref(vf);
|
||||
delete_vals(vl);
|
||||
vf->Error("not a function");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -640,8 +640,6 @@ bool Manager::RemoveFilter(EnumVal* id, string name)
|
|||
|
||||
bool Manager::Write(EnumVal* id, RecordVal* columns)
|
||||
{
|
||||
bool error = false;
|
||||
|
||||
Stream* stream = FindStream(id);
|
||||
if ( ! stream )
|
||||
return false;
|
||||
|
@ -850,9 +848,6 @@ bool Manager::Write(EnumVal* id, RecordVal* columns)
|
|||
|
||||
Unref(columns);
|
||||
|
||||
if ( error )
|
||||
RemoveDisabledWriters(stream);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue