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

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

commit 19e13ae47075142b417da2a640a16013e11d95f9
Author: Bryan Call <bc...@apache.org>
AuthorDate: Fri Jan 27 10:09:10 2023 -0800

    Don't reassign the ats_scoped_str
---
 mgmt/config/AddConfigFilesHere.cc | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/mgmt/config/AddConfigFilesHere.cc 
b/mgmt/config/AddConfigFilesHere.cc
index 52042839c..40cc844c7 100644
--- a/mgmt/config/AddConfigFilesHere.cc
+++ b/mgmt/config/AddConfigFilesHere.cc
@@ -27,7 +27,6 @@
 #include "tscore/Diags.h"
 #include "FileManager.h"
 #include "tscore/Errata.h"
-#include "tscore/ink_memory.h"
 
 static constexpr bool REQUIRED{true};
 static constexpr bool NOT_REQUIRED{false};
@@ -42,10 +41,7 @@ registerFile(const char *configName, const char 
*defaultName, bool isRequired)
 {
   bool found = false;
   ats_scoped_str fname(REC_readString(configName, &found));
-  if (!found) {
-    fname = defaultName;
-  }
-  FileManager::instance().addFile(fname, configName, false, isRequired);
+  FileManager::instance().addFile(found ? fname : defaultName, configName, 
false, isRequired);
 }
 
 //

Reply via email to