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

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


The following commit(s) were added to refs/heads/master by this push:
     new e2ab472434 CID-1544424 and CID1544430: use after free fix. (#11335)
e2ab472434 is described below

commit e2ab4724346d5daed1627b42fc4afb4af09ee144
Author: Damian Meden <[email protected]>
AuthorDate: Fri May 10 09:44:36 2024 +0200

    CID-1544424 and CID1544430: use after free fix. (#11335)
---
 src/proxy/http/remap/unit-tests/test_RemapPlugin.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/proxy/http/remap/unit-tests/test_RemapPlugin.cc 
b/src/proxy/http/remap/unit-tests/test_RemapPlugin.cc
index 455eb06946..8cf0831e03 100644
--- a/src/proxy/http/remap/unit-tests/test_RemapPlugin.cc
+++ b/src/proxy/http/remap/unit-tests/test_RemapPlugin.cc
@@ -114,7 +114,9 @@ loadPlugin(RemapPluginUnitTest *plugin, std::string &error, 
PluginDebugObject *&
 void
 cleanupSandBox(RemapPluginInfo *plugin)
 {
-  delete plugin;
+  if (plugin != nullptr) {
+    delete plugin;
+  }
   clean();
 }
 
@@ -263,7 +265,7 @@ SCENARIO("invoking plugin init", "[plugin][core]")
 
         checkCallTest(/* shouldHaveFailed */ false, result, error, 
expectedError, debugObject->initCalled);
       }
-      cleanupSandBox(plugin);
+      cleanupSandBox(nullptr);
     }
 
     WHEN("init fails")
@@ -327,7 +329,7 @@ SCENARIO("invoking plugin instance init", "[plugin][core]")
           CHECK(0 == strcmp(ARGV[i], debugObject->argv[i]));
         }
       }
-      cleanupSandBox(plugin);
+      cleanupSandBox(nullptr);
     }
 
     WHEN("instance init fails")

Reply via email to