Fix race condition in ConfigWriter::GetKeywords

fixes #10518
This commit is contained in:
Gunnar Beutner 2015-11-03 09:46:45 +01:00
parent 98e5492a40
commit ae23e456a6
1 changed files with 2 additions and 0 deletions

View File

@ -212,6 +212,8 @@ String ConfigWriter::EscapeIcingaString(const String& str)
const std::vector<String>& ConfigWriter::GetKeywords(void)
{
static std::vector<String> keywords;
static boost::mutex mutex;
boost::mutex::scoped_lock lock(mutex);
if (keywords.empty()) {
keywords.push_back("object");