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>
Wed, 25 Nov 2009 05:18:49 +0000 (00:18 -0500)
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 */