[Piglit] [PATCH] arb_bindless_texture: Fix memory leaks.
Vinson Lee
vlee at freedesktop.org
Wed Apr 12 23:16:21 UTC 2017
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;
}
--
2.9.3
More information about the Piglit
mailing list