]> granicus.if.org Git - icinga2/commitdiff
Fix crash in RepositoryUtility::AddObject
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 10 Dec 2014 09:35:18 +0000 (10:35 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 10 Dec 2014 09:35:18 +0000 (10:35 +0100)
refs #7822

lib/cli/repositoryutility.cpp

index d8207635c3380a6cf8064f5c32631e2985d2c4f9..b9d87c2906749da219652f4504dafcfc1b4b9322 100644 (file)
@@ -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);