Fix leak in ConfigCompiler::CompileStream

refs #8791
This commit is contained in:
Gunnar Beutner 2015-03-19 08:17:57 +01:00
parent 91b8a9fc4e
commit 0884265180

View File

@ -207,12 +207,17 @@ Expression *ConfigCompiler::CompileStream(const String& path, std::istream *stre
Utility::QueueAsyncCallback(boost::bind(&ConfigCompiler::CompileHelper, ctx)); Utility::QueueAsyncCallback(boost::bind(&ConfigCompiler::CompileHelper, ctx));
return new FutureExpression(ftr); return new FutureExpression(ftr);
} else { } else {
Expression *expr;
try { try {
return ctx->Compile(); expr = ctx->Compile();
} catch (...) { } catch (...) {
delete ctx; delete ctx;
throw; throw;
} }
delete ctx;
return expr;
} }
} }