diff --git a/CHANGES b/CHANGES index 2c817c6c2e..9252c9116b 100644 --- a/CHANGES +++ b/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) diff --git a/VERSION b/VERSION index 5b3925f440..45a87b058c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4-735 +2.4-737 diff --git a/aux/binpac b/aux/binpac index 8dbf2470ed..3664242a21 160000 --- a/aux/binpac +++ b/aux/binpac @@ -1 +1 @@ -Subproject commit 8dbf2470eda8f358ea225234e05b406da8e258f1 +Subproject commit 3664242a218c21100d62917866d6b8cb0d6f0fa1 diff --git a/src/Tag.cc b/src/Tag.cc index d125e4917b..04eb0c79b0 100644 --- a/src/Tag.cc +++ b/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 ) diff --git a/src/Tag.h b/src/Tag.h index a3d7197fa0..224fdd40f3 100644 --- a/src/Tag.h +++ b/src/Tag.h @@ -77,6 +77,11 @@ protected: */ Tag& operator=(const Tag& other); + /** + * Move assignment operator. + */ + Tag& operator=(const Tag&& other); + /** * Compares two tags for equality. */ diff --git a/src/Val.cc b/src/Val.cc index ca8551f7a7..ca70e1f5df 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -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; } diff --git a/src/logging/Manager.cc b/src/logging/Manager.cc index 9db43518ed..9a9fc3a3f8 100644 --- a/src/logging/Manager.cc +++ b/src/logging/Manager.cc @@ -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; }