From d709d913cb9015ab215f9c8cedc83af4bbeb105b Mon Sep 17 00:00:00 2001 From: Sarbojit2019 <52527887+SarbojitAMD@users.noreply.github.com> Date: Fri, 27 Mar 2020 14:08:30 +0530 Subject: [PATCH] Fix few memory leaks in HIP (#1969) [ROCm/hip-tests commit: 5144ee8c0402ec168bec3c234945aa53ef7b880c] --- .../hip-tests/samples/0_Intro/module_api/defaultDriver.cpp | 4 ++-- .../hip-tests/samples/0_Intro/module_api/launchKernelHcc.cpp | 4 ++-- projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp | 4 ++-- .../hip-tests/samples/0_Intro/module_api_global/runKernel.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/projects/hip-tests/samples/0_Intro/module_api/defaultDriver.cpp b/projects/hip-tests/samples/0_Intro/module_api/defaultDriver.cpp index ea36aabcf4..af8b413ac2 100644 --- a/projects/hip-tests/samples/0_Intro/module_api/defaultDriver.cpp +++ b/projects/hip-tests/samples/0_Intro/module_api/defaultDriver.cpp @@ -80,8 +80,8 @@ int main() { hipFree(Ad); hipFree(Bd); - delete A; - delete B; + delete[] A; + delete[] B; hipCtxDestroy(context); return 0; } diff --git a/projects/hip-tests/samples/0_Intro/module_api/launchKernelHcc.cpp b/projects/hip-tests/samples/0_Intro/module_api/launchKernelHcc.cpp index 38cf0d414c..90e569c5bc 100644 --- a/projects/hip-tests/samples/0_Intro/module_api/launchKernelHcc.cpp +++ b/projects/hip-tests/samples/0_Intro/module_api/launchKernelHcc.cpp @@ -107,8 +107,8 @@ int main() { hipFree(Ad); hipFree(Bd); - delete A; - delete B; + delete[] A; + delete[] B; hipCtxDestroy(context); return 0; } diff --git a/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp b/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp index a011b42666..1093b0dd54 100644 --- a/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp +++ b/projects/hip-tests/samples/0_Intro/module_api/runKernel.cpp @@ -99,8 +99,8 @@ int main() { hipFree(Ad); hipFree(Bd); - delete A; - delete B; + delete[] A; + delete[] B; hipCtxDestroy(context); return 0; } diff --git a/projects/hip-tests/samples/0_Intro/module_api_global/runKernel.cpp b/projects/hip-tests/samples/0_Intro/module_api_global/runKernel.cpp index 3a2804b7a2..4a2d49144c 100644 --- a/projects/hip-tests/samples/0_Intro/module_api_global/runKernel.cpp +++ b/projects/hip-tests/samples/0_Intro/module_api_global/runKernel.cpp @@ -154,8 +154,8 @@ int main() { hipFree(Ad); hipFree(Bd); - delete A; - delete B; + delete[] A; + delete[] B; hipCtxDestroy(context); return 0; }