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

Vinson Lee vlee at kemper.freedesktop.org
Fri Dec 4 00:10:41 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Mon Nov 23 00:57:37 2009 -0500

glu/sgi: Fix memory leak in gluScaleImage3D.
(cherry picked from commit b611f639b4bffdcca376293f7ce71af9f6bdbff3)

---

 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 4139c30..223621f 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -7384,6 +7384,8 @@ int gluScaleImage3D(GLenum format,
    afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format,
 				   GL_UNSIGNED_SHORT));
    if (beforeImage == NULL || afterImage == NULL) {
+       free(beforeImage);
+       free(afterImage);
        return GLU_OUT_OF_MEMORY;
    }
    retrieveStoreModes3D(&psm);



More information about the mesa-commit mailing list