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

Jan Vesely jan.vesely at rutgers.edu
Wed Dec 17 06:42:36 PST 2014


On Tue, 2014-12-16 at 22:20 -0800, Vinson Lee wrote:
> Fix Coverity "resource leak" defect.
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>

Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>

> ---
>  tests/cl/api/create-image.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tests/cl/api/create-image.c b/tests/cl/api/create-image.c
> index 46a98dd..a1e143b 100644
> --- a/tests/cl/api/create-image.c
> +++ b/tests/cl/api/create-image.c
> @@ -44,8 +44,11 @@ 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;
>  		}
> +
> +		free(image_support);
>  	}
>  	return false;
>  }

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141217/ada3455a/attachment.sig>


More information about the Piglit mailing list