glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore.
authorVinson Lee <vlee@vmware.com>
Wed, 25 Nov 2009 05:18:49 +0000 (00:18 -0500)
committerVinson Lee <vlee@vmware.com>
Fri, 4 Dec 2009 08:12:49 +0000 (00:12 -0800)
(cherry picked from commit f895abbd9777c4985aa40cf660c68f6d7333f0ec)

src/glu/sgi/libutil/mipmap.c

index a5d07a59cf75db1d19d97a7c73d4487332e1c18d..22d702291f0b1f3f47d013c33648be416985b108 100644 (file)
@@ -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 */