[Piglit] [PATCH v2] cl-api-enqueue-fill-image: Fix memory leaks.

Serge Martin edb+piglit at sigluy.net
Sun Nov 29 02:29:44 PST 2015


On Sunday 22 November 2015 15:10:59 Vinson Lee wrote:
> Fixes Coverity "resource leak" defects.
> 
> Suggested-by: Serge Martin <edb+piglit at sigluy.net>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>

Reviewed-by: Serge Martin <edb+piglit at sigluy.net>

> ---
>  tests/cl/api/enqueue-fill-image.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/cl/api/enqueue-fill-image.c
> b/tests/cl/api/enqueue-fill-image.c index ebcfba4..2839b67 100644
> --- a/tests/cl/api/enqueue-fill-image.c
> +++ b/tests/cl/api/enqueue-fill-image.c
> @@ -114,6 +114,9 @@ piglit_cl_test(const int argc,
>  		return PIGLIT_SKIP;
>  	}
> 
> +	free(image_support);
> +	image_support = NULL;
> +
>  	img_format.image_channel_order = CL_RGBA;
>  	img_format.image_channel_data_type = CL_UNSIGNED_INT8;
>  	img_desc.image_type = CL_MEM_OBJECT_IMAGE2D;
> @@ -325,7 +328,6 @@ piglit_cl_test(const int argc,
>  	 */
>  	/* This is a per device test, clCreateImage would have failed before */
> 
> -	free(image_support);
>  	clReleaseMemObject(image);
>  	return result;
>  #else



More information about the Piglit mailing list