From 6f5f7df9705e7eff95b88203b2b4ee95d52d55b8 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 31 Dec 2019 11:08:45 -0800 Subject: [PATCH] Fix memory leaks in various input framework error-handling cases --- src/input/Manager.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/input/Manager.cc b/src/input/Manager.cc index 44b819f04d..cbfa4086d9 100644 --- a/src/input/Manager.cc +++ b/src/input/Manager.cc @@ -444,6 +444,7 @@ bool Manager::CreateEventStream(RecordVal* fval) if ( status ) { reporter->Error("Input stream %s: Problem unrolling", stream_name.c_str()); + for ( auto& f : fieldsV ) delete f; return false; } @@ -453,6 +454,7 @@ bool Manager::CreateEventStream(RecordVal* fval) if ( ! res ) { delete stream; + for ( auto& f : fieldsV ) delete f; return false; } @@ -671,6 +673,7 @@ bool Manager::CreateTableStream(RecordVal* fval) if ( (valfields > 1) && (want_record->InternalInt() != 1) ) { reporter->Error("Input stream %s: Stream does not want a record (want_record=F), but has more then one value field.", stream_name.c_str()); + for ( auto& f : fieldsV ) delete f; return false; } @@ -680,6 +683,7 @@ bool Manager::CreateTableStream(RecordVal* fval) if ( status ) { reporter->Error("Input stream %s: Problem unrolling", stream_name.c_str()); + for ( auto& f : fieldsV ) delete f; return false; } @@ -689,6 +693,7 @@ bool Manager::CreateTableStream(RecordVal* fval) if ( ! res ) { delete stream; + for ( auto& f : fieldsV ) delete f; return false; } }