From ab8209cbcb6c8b7024b0888cf0897f03bad15e8c Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 29 Oct 2016 16:51:48 +0200 Subject: [PATCH] opencl: Fix mismatched new[] / free valgrind report: Mismatched free() / delete / delete [] gpuInfo->mpArryDevsID is created by "new cl_device_id[1]", so it must be destroyed by delete[]. Signed-off-by: Stefan Weil --- opencl/openclwrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencl/openclwrapper.cpp b/opencl/openclwrapper.cpp index dd5d3b3d..106db049 100644 --- a/opencl/openclwrapper.cpp +++ b/opencl/openclwrapper.cpp @@ -375,7 +375,7 @@ int OpenclDevice::ReleaseOpenclEnv( GPUEnv *gpuInfo ) } isInited = 0; gpuInfo->mnIsUserCreated = 0; - free( gpuInfo->mpArryDevsID ); + delete[] gpuInfo->mpArryDevsID; return 1; } int OpenclDevice::BinaryGenerated( const char * clFileName, FILE ** fhandle )