Fix double free in log filter (with incorrect config) MP-589
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 Jan 2015 07:24:41 +0000 (07:24 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 Jan 2015 07:24:41 +0000 (07:24 +0000)
src/filter_log.cpp
src/filter_log.hpp

index 1365f5b..2035b09 100644 (file)
@@ -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<LFilePtr> filter_log_files;
-
             boost::mutex m_session_mutex;
             std::map<mp::Session, std::string> m_sessions;
        };
@@ -93,7 +88,7 @@ namespace metaproxy_1 {
                      std::ostringstream &os);
             void flush();
         };
-
+        static std::list<yf::Log::Impl::LFilePtr> filter_log_files;
     }
 }
 
@@ -123,10 +118,6 @@ void yf::Log::process(mp::Package &package) const
 }
 
 
-// static initialization
-std::list<yf::Log::Impl::LFilePtr> yf::Log::Impl::filter_log_files;
-
-
 yf::Log::Impl::Impl(const std::string &x)
     : m_msg_config(x),
       m_1line(false),
index 764568c..c0aa477 100644 (file)
@@ -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<Impl> m_p;
         };
     }