[Piglit] [PATCH] ext_image_dma_buf: Fix memory leaks.

Brian Paul brianp at vmware.com
Thu Jul 14 02:15:28 UTC 2016


On 07/13/2016 05:05 PM, Vinson Lee wrote:
> Reported-by: Chad Versace <chad.versace at intel.com>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>   tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c b/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c
> index b172255732cf..31c27e6992ce 100644
> --- a/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c
> +++ b/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c
> @@ -263,8 +263,10 @@ piglit_display(void)
>   	glUniform1i(glGetUniformLocation(prog, "u_r8_tex"), 0);
>   	glUniform1i(glGetUniformLocation(prog, "u_gr88_tex"), 1);
>
> -	if (!piglit_check_gl_error(GL_NO_ERROR))
> +	if (!piglit_check_gl_error(GL_NO_ERROR)) {
> +		free(ref_rgba_image);
>   		piglit_report_result(PIGLIT_FAIL);
> +	}
>
>   	glGenBuffers(1, &vb);
>   	glBindBuffer(GL_ARRAY_BUFFER, vb);
> @@ -282,8 +284,10 @@ piglit_display(void)
>   	glClear(GL_COLOR_BUFFER_BIT);
>   	glDrawArrays(GL_TRIANGLE_FAN, /*first*/ 0, /*count*/ 4);
>
> -	if (!piglit_check_gl_error(GL_NO_ERROR))
> +	if (!piglit_check_gl_error(GL_NO_ERROR)) {
> +		free(ref_rgba_image);
>   		piglit_report_result(PIGLIT_FAIL);
> +	}
>
>   	/* Increase the tolerance because the conversion path
>   	 *     ubyte --(texturing)--> float --(glReadPixels)--> ubyte
>

Looks OK to me.  Though, to be honest, I don't think we're too concerned 
about memory leaks in most piglit tests.  Their execution life is pretty 
short.

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list