From 76d7fe1114fc4b62fcf774c17625f576162b5a4e Mon Sep 17 00:00:00 2001 From: Rakesh Roy Date: Tue, 12 Aug 2025 11:56:53 +0530 Subject: [PATCH] SWDEV-548453 - Fix memory leak --- catch/unit/kernel/hipLaunchKernelEx.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/catch/unit/kernel/hipLaunchKernelEx.cc b/catch/unit/kernel/hipLaunchKernelEx.cc index a41fb2d4b..c7717b8de 100644 --- a/catch/unit/kernel/hipLaunchKernelEx.cc +++ b/catch/unit/kernel/hipLaunchKernelEx.cc @@ -197,6 +197,7 @@ TEST_CASE("Unit_hipLaunchKernelExC_NegetiveTsts") { kernelArgs), hipErrorInvalidConfiguration); } + HIP_CHECK(hipFree(d_output)); } /** * Test Description @@ -264,6 +265,7 @@ TEST_CASE("Unit_hipLaunchKernelEx_NegetiveTsts") { d_output, totalThreads), hipErrorInvalidConfiguration); } + HIP_CHECK(hipFree(d_output)); } bool runTest(const char *testName, const void *kernelFunc, int totalThreads, @@ -422,6 +424,7 @@ TEST_CASE("Unit_hipLaunchKernelEx_With_Different_Kernels") { int result = 0; HIP_CHECK(hipMemcpy(&result, devMem, sizeof(result), hipMemcpyDefault)); + HIP_CHECK(hipFree(devMem)); REQUIRE(result == 100); }