[Piglit] [PATCH] arb_get_texture_sub_image: Remove unused allocations.

Vinson Lee vlee at freedesktop.org
Tue Nov 17 00:07:57 PST 2015


These allocations are never used and are also leaked when later
allocations are assigned to the same pointers.

Fixes Coverity "resource leak" defects.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_get_texture_sub_image/getcompressed.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_get_texture_sub_image/getcompressed.c b/tests/spec/arb_get_texture_sub_image/getcompressed.c
index 63a722d..488cde9 100644
--- a/tests/spec/arb_get_texture_sub_image/getcompressed.c
+++ b/tests/spec/arb_get_texture_sub_image/getcompressed.c
@@ -40,10 +40,9 @@ test_getsubimage(GLenum target,
 		 GLsizei width, GLsizei height, GLsizei numSlices,
 		 GLenum intFormat)
 {
-	const GLint bufSize = width * height * 4 * sizeof(GLubyte);
 	GLubyte *texData;
-	GLubyte *refData = malloc(6 * bufSize); /* 6 for cubemaps */
-	GLubyte *testData = malloc(6 * bufSize); /* 6 for cubemaps */
+	GLubyte *refData;
+	GLubyte *testData;
 	GLuint tex;
 	int i, slice, compressedSize, compSize;
 	int blockWidth, blockHeight, blockSize;
-- 
2.6.3



More information about the Piglit mailing list