diff --git a/projects/hip-tests/catch/unit/rtc/hipRTCDeviceMalloc.cc b/projects/hip-tests/catch/unit/rtc/hipRTCDeviceMalloc.cc index e8857ff638..ecccaeaba1 100644 --- a/projects/hip-tests/catch/unit/rtc/hipRTCDeviceMalloc.cc +++ b/projects/hip-tests/catch/unit/rtc/hipRTCDeviceMalloc.cc @@ -125,6 +125,8 @@ TEST_CASE("Unit_hiprtc_devicemalloc") { HIP_CHECK(hipFree(dX)); HIP_CHECK(hipFree(dY)); + HIP_CHECK(hipFree(pA)); + HIP_CHECK(hipFree(pB)); HIP_CHECK(hipFree(dOut)); HIP_CHECK(hipModuleUnload(module)); diff --git a/projects/hip-tests/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc b/projects/hip-tests/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc index 10a3341759..b5a536d7e3 100644 --- a/projects/hip-tests/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc +++ b/projects/hip-tests/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc @@ -166,11 +166,7 @@ TEST_CASE("Unit_Rtc_MathConstants_header") { const char* compiler_option = complete_CO.c_str(); for (int scenario = 0; scenario < 2; scenario++) { hiprtcProgram prog; - const char** compiler_options = new const char*[2]; - for (int i = 0; i < 2; i++) { - compiler_options[0] = compiler_option; - compiler_options[1] = ""; - } + std::array compiler_options = {compiler_option, ""}; HIPRTC_CHECK(hiprtcCreateProgram(&prog, mathConstants_string, kername, 0, NULL, NULL)); if (scenario == 0) { hiprtcResult compileResult{hiprtcCompileProgram(prog, 1, &compiler_option)}; @@ -184,7 +180,7 @@ TEST_CASE("Unit_Rtc_MathConstants_header") { REQUIRE(false); } } else { - hiprtcResult compileResult{hiprtcCompileProgram(prog, 2, compiler_options)}; + hiprtcResult compileResult{hiprtcCompileProgram(prog, 2, compiler_options.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { WARN("hiprtcCompileProgram() api failed!!"); size_t logSize; diff --git a/projects/hip-tests/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc b/projects/hip-tests/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc index 82bcd2a326..707598a173 100644 --- a/projects/hip-tests/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc +++ b/projects/hip-tests/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc @@ -135,6 +135,7 @@ TEST_CASE("Unit_Rtc_bfloat16_header") { } } HIP_CHECK(hipModuleUnload(module)); + HIP_CHECK(hipFree(result_d)); HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); delete[] result_h; }