diff --git a/projects/clr/hipamd/api/hip/hip_rtc.cpp b/projects/clr/hipamd/api/hip/hip_rtc.cpp index e3cfd3f885..093c828975 100644 --- a/projects/clr/hipamd/api/hip/hip_rtc.cpp +++ b/projects/clr/hipamd/api/hip/hip_rtc.cpp @@ -312,7 +312,9 @@ hiprtcResult hiprtcDestroyProgram(hiprtcProgram* prog) { if (prog == NULL) { HIPRTC_RETURN(HIPRTC_ERROR_INVALID_INPUT); } - amd::Program* program = as_amd(reinterpret_cast(prog)); + + // Release program. hiprtcProgram is a double pointer so free *prog + amd::Program* program = as_amd(reinterpret_cast(*prog)); program->release();