Mesa (mesa_7_6_branch): glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore.

Vinson Lee vlee at kemper.freedesktop.org
Fri Dec 4 00:13:09 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 7b5eba453e08dfad151d09ba4d308cbdf4fc83af
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b5eba453e08dfad151d09ba4d308cbdf4fc83af

Author: Vinson Lee <vlee at vmware.com>
Date:   Wed Nov 25 00:18:49 2009 -0500

glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore.
(cherry picked from commit f895abbd9777c4985aa40cf660c68f6d7333f0ec)

---

 src/glu/sgi/libutil/mipmap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c
index a5d07a5..22d7022 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -8098,6 +8098,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat,
 	 glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
 	 glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images);
 	 glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height);
+	 free(srcImage);
 	 return GLU_OUT_OF_MEMORY;
        }
        /* level userLevel+1 is in srcImage; level userLevel already saved */



More information about the mesa-commit mailing list