This is an automated email from the ASF dual-hosted git repository.

oknet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ee2a26  resolve stack-use-after-scope in YamlLogConfig.cc
0ee2a26 is described below

commit 0ee2a26d735c8047688e660f134a6c2cd99ee913
Author: cichang.chen <[email protected]>
AuthorDate: Mon Jan 21 20:44:42 2019 +0800

    resolve stack-use-after-scope in YamlLogConfig.cc
    
    fix warning in YamlLogConfig.cc
---
 proxy/logging/YamlLogConfig.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxy/logging/YamlLogConfig.cc b/proxy/logging/YamlLogConfig.cc
index b3fd5bc..cc4c6ac 100644
--- a/proxy/logging/YamlLogConfig.cc
+++ b/proxy/logging/YamlLogConfig.cc
@@ -206,10 +206,10 @@ YamlLogConfig::decodeLogObject(const YAML::Node &node)
   }
 
   for (auto &&filter : filters) {
-    const char *filter_name = filter.as<std::string>().c_str();
-    LogFilter *f            = cfg->filter_list.find_by_name(filter_name);
+    std::string filter_name = filter.as<std::string>().c_str();
+    LogFilter *f            = 
cfg->filter_list.find_by_name(filter_name.c_str());
     if (!f) {
-      Warning("Filter %s is not a known filter; cannot add to this LogObject", 
filter_name);
+      Warning("Filter %s is not a known filter; cannot add to this LogObject", 
filter_name.c_str());
     } else {
       logObject->add_filter(f);
     }

Reply via email to