From: Gunnar Beutner Date: Fri, 17 Oct 2014 18:47:48 +0000 (+0200) Subject: Add missing locks X-Git-Tag: v2.2.0~344 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6193255446a17601acc31693069c05c2ade47ea9;p=icinga2 Add missing locks refs #7251 --- diff --git a/lib/cli/objectlistcommand.cpp b/lib/cli/objectlistcommand.cpp index 9c5a40351..db8e2b3b1 100644 --- a/lib/cli/objectlistcommand.cpp +++ b/lib/cli/objectlistcommand.cpp @@ -162,6 +162,8 @@ void ObjectListCommand::PrintProperties(std::ostream& fp, const Dictionary::Ptr& int offset = 2; + ObjectLock olock(props); + BOOST_FOREACH(const Dictionary::Pair& kv, props) { String key = kv.first; Value val = kv.second; @@ -195,6 +197,8 @@ void ObjectListCommand::PrintHints(std::ostream& fp, const Dictionary::Ptr& debu Array::Ptr messages = debug_hints->Get("messages"); + ObjectLock olock(messages); + BOOST_FOREACH(const Value& msg, messages) { PrintHint(fp, msg, indent); }