From cfa8769a422fa9ec1eeb4592f8b2eea6ef5a2a58 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 24 Jul 2012 11:22:51 -0500 Subject: [PATCH] Fix memory leak when processing a thread's input message fails. The message is reclaimed in both success/fail cases now. --- src/threading/MsgThread.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/threading/MsgThread.cc b/src/threading/MsgThread.cc index b7a8f4922c..48c7253885 100644 --- a/src/threading/MsgThread.cc +++ b/src/threading/MsgThread.cc @@ -342,14 +342,14 @@ void MsgThread::Run() bool result = msg->Process(); + delete msg; + if ( ! result ) { string s = Fmt("%s failed, terminating thread (MsgThread)", Name()); Error(s.c_str()); break; } - - delete msg; } // In case we haven't send the finish method yet, do it now. Reading