summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmarnath Valluri <amarnath.valluri@intel.com>2016-06-10 05:30:00 -0600
committerBrian Paul <brianp@vmware.com>2016-06-10 07:26:52 -0600
commit0bf42e41c8b63fc2488dd8d41f696310b5a5a6a7 (patch)
tree9217f437c9955046ba17c4d5a5d8dfdfdaa8c683
parent069211570c32a8d5848e127975a2943e9d8fc6b9 (diff)
downloadglu-0bf42e41c8b63fc2488dd8d41f696310b5a5a6a7.tar.gz
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>
-rw-r--r--src/libutil/mipmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libutil/mipmap.c b/src/libutil/mipmap.c
index c475c96..483c3fe 100644
--- a/src/libutil/mipmap.c
+++ b/src/libutil/mipmap.c
@@ -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;
}