From e1799cc6035fad24ca89af446448278009eb25de Mon Sep 17 00:00:00 2001 From: "cichang.chen" Date: Mon, 21 Jan 2019 20:44:42 +0800 Subject: [PATCH] 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 b3fd5bcdc8f..cc4c6ace7b8 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().c_str(); - LogFilter *f = cfg->filter_list.find_by_name(filter_name); + std::string filter_name = filter.as().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); }