[Piglit] [PATCH] cl-api-get-kernel-work-group-info: Fix memory leak.

Vinson Lee vlee at freedesktop.org
Mon Aug 17 21:37:14 PDT 2015


Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/cl/api/get-kernel-work-group-info.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/cl/api/get-kernel-work-group-info.c b/tests/cl/api/get-kernel-work-group-info.c
index 5942e15..4a393c3 100644
--- a/tests/cl/api/get-kernel-work-group-info.c
+++ b/tests/cl/api/get-kernel-work-group-info.c
@@ -94,6 +94,7 @@ piglit_cl_test(const int argc,
 			   piglit_cl_get_device_info(env->device_id, CL_DEVICE_TYPE);
 			if (*dev_type_ptr != CL_DEVICE_TYPE_CUSTOM)
 				success_code = CL_INVALID_VALUE;
+			free(dev_type_ptr);
 		}
 #endif
 
-- 
2.1.4



More information about the Piglit mailing list