From 245cb0e9301ebf89bd7e3a572e3a1aefd6d3dbcd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 1 Feb 2017 12:56:53 +0100 Subject: [PATCH] Fix crash in ConfigItem::RemoveIgnoredItems fixes #4952 --- lib/config/configitem.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 4bafd3d02..86f3118e3 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -657,8 +657,7 @@ std::vector ConfigItem::GetItems(const String& type) items.reserve(it->second.size()); - for (const ItemMap::value_type& kv : it->second) - { + for (const ItemMap::value_type& kv : it->second) { items.push_back(kv.second); } @@ -678,8 +677,7 @@ std::vector ConfigItem::GetDefaultTemplates(const String& type) items.reserve(it->second.size()); - for (const ItemMap::value_type& kv : it->second) - { + for (const ItemMap::value_type& kv : it->second) { items.push_back(kv.second); } @@ -697,12 +695,7 @@ void ConfigItem::RemoveIgnoredItems(const String& allowedConfigPath) Log(LogNotice, "ConfigItem") << "Removing ignored item path '" << path << "'."; - if (unlink(path.CStr()) < 0) { - BOOST_THROW_EXCEPTION(posix_error() - << boost::errinfo_api_function("unlink") - << boost::errinfo_errno(errno) - << boost::errinfo_file_name(path)); - } + (void) unlink(path.CStr()); } m_IgnoredItems.clear();