glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore.
authorVinson Lee <vlee@vmware.com>
Wed, 25 Nov 2009 05:28:56 +0000 (00:28 -0500)
committerVinson Lee <vlee@vmware.com>
Fri, 4 Dec 2009 08:13:25 +0000 (00:13 -0800)
(cherry picked from commit 0d89f3dc7ff3f89ba8d5d664253730485bca35e2)

src/glu/sgi/libutil/mipmap.c

index 22d702291f0b1f3f47d013c33648be416985b108..796be0aad383eac6662757a62719f855dac319f5 100644 (file)
@@ -4349,6 +4349,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
            glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
            glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
            glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+           free(srcImage);
            return GLU_OUT_OF_MEMORY;
          }
        }