[Piglit] [PATCH] cl-api-create-sampler: Fix memory leak.

Vinson Lee vlee at freedesktop.org
Mon Jan 19 12:51:42 PST 2015


Fix resource leak defect reported by Coverity.

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

diff --git a/tests/cl/api/create-sampler.c b/tests/cl/api/create-sampler.c
index cce5f87..99423a3 100644
--- a/tests/cl/api/create-sampler.c
+++ b/tests/cl/api/create-sampler.c
@@ -44,6 +44,7 @@ static bool context_has_image_support(const piglit_cl_context ctx)
 			piglit_cl_get_device_info(ctx->device_ids[i],
 						CL_DEVICE_IMAGE_SUPPORT);
 		if (*image_support) {
+			free(image_support);
 			return true;
 		}
 	}
-- 
2.2.1



More information about the Piglit mailing list