JosiahWI commented on code in PR #13552:
URL: https://github.com/apache/trafficserver/pull/13552#discussion_r3803700127


##########
plugins/experimental/stale_response/stale_response.cc:
##########
@@ -1070,6 +1070,10 @@ parse_args(int argc, char const *argv[])
       plugin_config->log_info.stale_if_error = true;
       break;
     case 'd':
+      // The option may be repeated; release the previously duplicated name 
first.
+      if (plugin_config->log_info.filename != PLUGIN_TAG) {
+        free(const_cast<char *>(plugin_config->log_info.filename));

Review Comment:
   Can we store the filename as non-const instead?



##########
plugins/xdebug/xdebug.cc:
##########
@@ -947,6 +947,7 @@ TSPluginInit(int argc, const char *argv[])
     switch (opt) {
     case 'h':
       Dbg(dbg_ctl, "Setting header: %s", optarg);
+      TSfree(const_cast<char *>(xDebugHeader.str)); // The option can be 
repeated, so the earlier value is not leaked

Review Comment:
   Can we store the `str` field as non-const instead?



##########
plugins/experimental/jax_fingerprint/plugin.cc:
##########
@@ -445,19 +451,17 @@ TSReturnCode
 TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf 
ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
 {
   Dbg(dbg_ctl, "New instance for client matching %s to %s", argv[0], argv[1]);
-  auto config         = new PluginConfig();
+  auto config         = std::make_unique<PluginConfig>();

Review Comment:
   The naming here and below is inconsistent with the naming change earlier in 
the file. Please use consistent naming.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to