From: Adam Dickmeiss Date: Mon, 19 Jan 2015 07:24:41 +0000 (+0000) Subject: Fix double free in log filter (with incorrect config) MP-589 X-Git-Tag: v1.8.1~1 X-Git-Url: http://git.indexdata.com/?p=metaproxy-moved-to-github.git;a=commitdiff_plain;h=be6623c7d58454621fa4377de92f24933133d9d2 Fix double free in log filter (with incorrect config) MP-589 --- diff --git a/src/filter_log.cpp b/src/filter_log.cpp index 1365f5b..2035b09 100644 --- a/src/filter_log.cpp +++ b/src/filter_log.cpp @@ -72,11 +72,6 @@ namespace metaproxy_1 { bool m_init_options; LFilePtr m_file; std::string m_time_format; - // Only used during confiqgure stage (no threading), - // for performance avoid opening files which other log filter - // instances already have opened - static std::list filter_log_files; - boost::mutex m_session_mutex; std::map m_sessions; }; @@ -93,7 +88,7 @@ namespace metaproxy_1 { std::ostringstream &os); void flush(); }; - + static std::list filter_log_files; } } @@ -123,10 +118,6 @@ void yf::Log::process(mp::Package &package) const } -// static initialization -std::list yf::Log::Impl::filter_log_files; - - yf::Log::Impl::Impl(const std::string &x) : m_msg_config(x), m_1line(false), diff --git a/src/filter_log.hpp b/src/filter_log.hpp index 764568c..c0aa477 100644 --- a/src/filter_log.hpp +++ b/src/filter_log.hpp @@ -34,8 +34,8 @@ namespace metaproxy_1 { void process(metaproxy_1::Package & package) const; void configure(const xmlNode * ptr, bool test_only, const char *path); - private: class Impl; + private: boost::scoped_ptr m_p; }; }