From: Gunnar Beutner Date: Wed, 10 Dec 2014 09:35:18 +0000 (+0100) Subject: Fix crash in RepositoryUtility::AddObject X-Git-Tag: v2.3.0~537 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a2460ae67e3650853caa2ecdc7757d3eb5240ac;p=icinga2 Fix crash in RepositoryUtility::AddObject refs #7822 --- diff --git a/lib/cli/repositoryutility.cpp b/lib/cli/repositoryutility.cpp index d8207635c..b9d87c290 100644 --- a/lib/cli/repositoryutility.cpp +++ b/lib/cli/repositoryutility.cpp @@ -232,7 +232,12 @@ bool RepositoryUtility::AddObject(const String& name, const String& type, const String fname, fragment; BOOST_FOREACH(boost::tie(fname, fragment), ConfigFragmentRegistry::GetInstance()->GetItems()) { - ConfigCompiler::CompileText(fname, fragment); + Expression *expression = ConfigCompiler::CompileText(fname, fragment); + if (expression) { + VMFrame frame; + expression->Evaluate(frame); + delete expression; + } } ConfigType::Ptr ctype = ConfigType::GetByName(type);