]> granicus.if.org Git - icinga2/commitdiff
Fix livestatus query on commands table with custom vars
authorMichael Friedrich <michael.friedrich@netways.de>
Mon, 16 Feb 2015 13:16:45 +0000 (14:16 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 16 Feb 2015 13:16:45 +0000 (14:16 +0100)
fixes #8452

lib/livestatus/commandstable.cpp

index b2178886a7a0e8cb2cb869fef78b26e25ccf49e4..756f1d322235c25b7d521082bcbaa8bd0380eec3 100644 (file)
@@ -109,6 +109,8 @@ Value CommandsTable::CustomVariableNamesAccessor(const Value& row)
 
        String key;
        Value value;
+
+       ObjectLock xlock(vars);
        BOOST_FOREACH(tie(key, value), vars) {
                cv->Add(key);
        }
@@ -137,6 +139,8 @@ Value CommandsTable::CustomVariableValuesAccessor(const Value& row)
 
        String key;
        Value value;
+
+       ObjectLock xlock(vars);
        BOOST_FOREACH(tie(key, value), vars) {
                cv->Add(value);
        }
@@ -165,6 +169,8 @@ Value CommandsTable::CustomVariablesAccessor(const Value& row)
 
        String key;
        Value value;
+
+       ObjectLock xlock(vars);
        BOOST_FOREACH(tie(key, value), vars) {
                Array::Ptr key_val = new Array();
                key_val->Add(key);