From 088426518060783bc4ebbf8ad2e29c29683a99c2 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 19 Mar 2015 08:17:57 +0100 Subject: [PATCH] Fix leak in ConfigCompiler::CompileStream refs #8791 --- lib/config/configcompiler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp index 5f255f253..8fc48c64f 100644 --- a/lib/config/configcompiler.cpp +++ b/lib/config/configcompiler.cpp @@ -207,12 +207,17 @@ Expression *ConfigCompiler::CompileStream(const String& path, std::istream *stre Utility::QueueAsyncCallback(boost::bind(&ConfigCompiler::CompileHelper, ctx)); return new FutureExpression(ftr); } else { + Expression *expr; + try { - return ctx->Compile(); + expr = ctx->Compile(); } catch (...) { delete ctx; throw; } + + delete ctx; + return expr; } } -- 2.40.0