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

Vinson Lee vlee at kemper.freedesktop.org
Fri Dec 4 08:09:38 UTC 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Sun Nov 22 01:57:35 2009 -0500

glu/sgi: Fix memory leak in gluScaleImage.
(cherry picked from commit a9c540f5dedbf593f8038fdbc95eecb60826ab26)

---

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

diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c
index af647af..4139c30 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -3526,6 +3526,8 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin,
     afterImage =
 	malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT));
     if (beforeImage == NULL || afterImage == NULL) {
+	free(beforeImage);
+	free(afterImage);
 	return GLU_OUT_OF_MEMORY;
     }
 




More information about the mesa-commit mailing list