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
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}
}