[Piglit] [PATCH] arb_direct_state_access: Fix memory leak.

Vinson Lee vlee at freedesktop.org
Thu Jan 8 17:43:55 PST 2015


Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_direct_state_access/getcompressedtextureimage.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
index 734ef72..0d862a5 100644
--- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
+++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
@@ -101,6 +101,7 @@ make_layer_data(int num_layers)
 		GLubyte *data = piglit_rgbw_image_ubyte(IMAGE_WIDTH,
 							IMAGE_HEIGHT, true);
 		memcpy(layer_data + IMAGE_SIZE * z, data, IMAGE_SIZE);
+		free(data);
 	}
 
 	/* Show the first layer of the completed layer data. */
-- 
2.1.0



More information about the Piglit mailing list