You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2019/10/30 22:15:18 UTC

[trafficserver] 03/05: resolve stack-use-after-scope in YamlLogConfig.cc

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

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 661583ffde8e3ac5503114fd2386ed723513b99c
Author: cichang.chen <ci...@verycloud.cn>
AuthorDate: Mon Jan 21 20:44:42 2019 +0800

    resolve stack-use-after-scope in YamlLogConfig.cc
    
    fix warning in YamlLogConfig.cc
    
    (cherry picked from commit 0ee2a26d735c8047688e660f134a6c2cd99ee913)
---
 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 07bfcfb..2b3da66 100644
--- a/proxy/logging/YamlLogConfig.cc
+++ b/proxy/logging/YamlLogConfig.cc
@@ -186,10 +186,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);
     }