From 80fe3d5583283a1b65e4c0b8c068a1ba607abcb7 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 4 Jun 2019 19:28:06 -0700 Subject: [PATCH] Simplify threading::Value destructor --- CHANGES | 6 ++++++ VERSION | 2 +- src/threading/SerialTypes.cc | 12 +++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 96b1e74a6d..f96eacf9d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ +2.6-375 | 2019-06-04 19:28:06 -0700 + + * Simplify threading::Value destructor (Jon Siwek, Corelight) + + * Add pattern support to input framework. (Zeke Medley, Corelight) + 2.6-369 | 2019-06-04 17:53:10 -0700 * GH-155: Improve coercion of expression lists to vector types (Tim Wojtulewicz, Corelight) diff --git a/VERSION b/VERSION index a5f150802d..bea240e646 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6-369 +2.6-375 diff --git a/src/threading/SerialTypes.cc b/src/threading/SerialTypes.cc index 26817e7a86..bd85b846f9 100644 --- a/src/threading/SerialTypes.cc +++ b/src/threading/SerialTypes.cc @@ -87,14 +87,16 @@ string Field::TypeName() const Value::~Value() { - if ( (type == TYPE_ENUM || type == TYPE_STRING || type == TYPE_FILE || type == TYPE_FUNC) - && present ) + if ( ! present ) + return; + + if ( type == TYPE_ENUM || type == TYPE_STRING || type == TYPE_FILE || type == TYPE_FUNC ) delete [] val.string_val.data; - if ( type == TYPE_PATTERN && present) + else if ( type == TYPE_PATTERN ) delete [] val.pattern_text_val; - if ( type == TYPE_TABLE && present ) + else if ( type == TYPE_TABLE ) { for ( int i = 0; i < val.set_val.size; i++ ) delete val.set_val.vals[i]; @@ -102,7 +104,7 @@ Value::~Value() delete [] val.set_val.vals; } - if ( type == TYPE_VECTOR && present ) + else if ( type == TYPE_VECTOR ) { for ( int i = 0; i < val.vector_val.size; i++ ) delete val.vector_val.vals[i];