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

Brian Paul brianp at vmware.com
Tue Nov 17 06:44:03 PST 2015


On 11/17/2015 01:07 AM, Vinson Lee wrote:
> 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;
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list