From 635437f5fdcbd8274f1505ae0e2750ceca3060c5 Mon Sep 17 00:00:00 2001 From: Gil Pitney Date: Wed, 17 Jun 2015 00:49:55 +0000 Subject: clCreateProgramWithBinary(): fix memory leak. Memory for a temporary array of context devices was not getting freed. Signed-off-by: Gil Pitney --- src/api/api_program.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/api/api_program.cpp b/src/api/api_program.cpp index 5dd6350..4afd603 100644 --- a/src/api/api_program.cpp +++ b/src/api/api_program.cpp @@ -119,9 +119,10 @@ clCreateProgramWithBinary(cl_context context, context_num_devices * sizeof(cl_device_id), context_devices, 0); - if (*errcode_ret != CL_SUCCESS) + if (*errcode_ret != CL_SUCCESS) { + std::free(context_devices); return 0; - + } for (cl_uint i=0; i