This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit aaa76b6d1432e9c43503acf6d26347ed65c87b04 Author: Damian Meden <[email protected]> AuthorDate: Fri May 10 09:44:36 2024 +0200 CID-1544424 and CID1544430: use after free fix. (#11335) (cherry picked from commit e2ab4724346d5daed1627b42fc4afb4af09ee144) --- 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 efd8e11ed2..cae770af06 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")
