You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/09/08 21:36:25 UTC

[GitHub] [trafficserver] ywkaras commented on a diff in pull request #9004: Clean up spurious errors in output of ASAN build.

ywkaras commented on code in PR #9004:
URL: https://github.com/apache/trafficserver/pull/9004#discussion_r966441607


##########
proxy/logging/LogConfig.cc:
##########
@@ -156,9 +156,13 @@ LogConfig::read_configuration_variables()
   ats_free(ptr);
 
   ptr = REC_ConfigReadString("proxy.config.log.hostname");
-  if (ptr != nullptr && std::string_view(ptr) != "localhost") {
-    ats_free(hostname);
-    hostname = ptr;
+  if (ptr != nullptr) {
+    if (std::string_view(ptr) != "localhost") {
+      ats_free(hostname);
+      hostname = ptr;
+    } else {
+      ats_free(ptr);
+    }

Review Comment:
   This fixes a small actual (non-spurious) leak.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org