[Piglit] [PATCH] max-texture-size: Fix memory leak.

Vinson Lee vlee at freedesktop.org
Mon Dec 10 23:11:15 PST 2012


Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/texturing/max-texture-size.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/texturing/max-texture-size.c b/tests/texturing/max-texture-size.c
index a05518c..28e8fb0 100644
--- a/tests/texturing/max-texture-size.c
+++ b/tests/texturing/max-texture-size.c
@@ -292,6 +292,7 @@ ValidateTexSize (GLenum target,  GLenum internalformat, bool useProxy)
 		/* Report a GL error other than GL_OUT_OF_MEMORY */
 		if (err != GL_NO_ERROR && err != GL_OUT_OF_MEMORY) {
 			printf("Unexpected GL error: 0x%x\n", err);
+			free(pixels);
 			return false;
 		}
 		break;
-- 
1.8.0.1



More information about the Piglit mailing list