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

Vinson Lee vlee at freedesktop.org
Wed Jul 13 23:05:25 UTC 2016


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
-- 
2.7.4



More information about the Piglit mailing list