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

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Apr 13 07:50:38 UTC 2017


There is memleak in 
call_CompressedTexSubImage_when_texture_is_referenced() also. Can you 
fix that one?

Thanks for noticing.

On 04/13/2017 01:16 AM, Vinson Lee wrote:
> CID: 1405026
> Fixes: 66676a2fcd48 ("add API-related tests for ARB_bindless_texture")
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>   tests/spec/arb_bindless_texture/legal.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/spec/arb_bindless_texture/legal.c b/tests/spec/arb_bindless_texture/legal.c
> index 0084e7dea965..cede6da74379 100644
> --- a/tests/spec/arb_bindless_texture/legal.c
> +++ b/tests/spec/arb_bindless_texture/legal.c
> @@ -48,8 +48,10 @@ call_TexSubImage_when_texture_is_referenced(void *data)
>   	tex = piglit_integer_texture(GL_RGBA32I, 16, 16, 0, 0);
>   
>   	glGetTextureHandleARB(tex);
> -	if (!piglit_check_gl_error(GL_NO_ERROR))
> +	if (!piglit_check_gl_error(GL_NO_ERROR)) {
> +		free(img);
>   		return PIGLIT_FAIL;
> +	}
>   
>   	/* The ARB_bindless_texture spec says:
>   	 *
> @@ -61,10 +63,10 @@ call_TexSubImage_when_texture_is_referenced(void *data)
>   	 */
>   	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 16, 16, GL_RGBA_INTEGER,
>   			GL_INT, img);
> +	free(img);
>   	if (!piglit_check_gl_error(GL_NO_ERROR))
>   		return PIGLIT_FAIL;
>   
> -	free(img);
>   	return PIGLIT_PASS;
>   }
>   
> 


More information about the Piglit mailing list