libutils/mipmap.c: Fixed possible memory leak

In case of malloc() failure memory allocated for both 'srcImage'
and 'dstImage' is leaked.

Patch simplified by Brian Paul.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96480
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Amarnath Valluri
2016-06-10 05:30:00 -06:00
committed by Brian Paul
parent 069211570c
commit 0bf42e41c8

View File

@@ -4509,6 +4509,8 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
free(srcImage);
free(dstImage);
return GLU_OUT_OF_MEMORY;
}