From 109eabeca3811f34ce3d5ecc0a260aa9f3249e5f Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 3 Oct 2016 06:52:09 -0400 Subject: [PATCH] P4 to Git Change 1321686 by emankov@em-hsa-amd on 2016/10/03 06:43:39 SWDEV-103207 - FIX: clCreateProgramWithBinary memory leak - REGRESSION Leaks were in Runtime in functions Program::addDeviceProgram and Program::link. [Testing] http://ocltc.amd.com:8111/viewModification.html?modId=77100&personal=true&init=1&tab=vcsModificationBuilds&show_all_builds=true [Reviewer] Stanislav Mekhanoshin Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#84 edit --- rocclr/runtime/platform/program.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rocclr/runtime/platform/program.cpp b/rocclr/runtime/platform/program.cpp index ab90eca979..f883deca97 100644 --- a/rocclr/runtime/platform/program.cpp +++ b/rocclr/runtime/platform/program.cpp @@ -102,6 +102,7 @@ Program::addDeviceProgram(Device& device, const void* image, size_t length, } } options->oVariables->Legacy = isAMDILTarget(*aclutGetTargetInfo(binary)); + aclBinaryFini(binary); } #endif // !defined(WITH_LIGHTNING_COMPILER) options->oVariables->BinaryIsSpirv = isSPIRV_; @@ -332,6 +333,7 @@ Program::link( } else if (isAMDILTarget(*aclutGetTargetInfo(aclBin))) { parsedOptions.oVariables->Frontend = "edg"; } + aclBinaryFini(aclBin); } #endif // !defined(WITH_LIGHTNING_COMPILER) found = true;