glu/sgi: Fix memory leak in gluBuild1DMipmapLevelsCore.
authorVinson Lee <vlee@vmware.com>
Wed, 25 Nov 2009 05:39:37 +0000 (00:39 -0500)
committerVinson Lee <vlee@vmware.com>
Fri, 4 Dec 2009 08:14:05 +0000 (00:14 -0800)
(cherry picked from commit 94bcb9f1a43f2ab3bdff09156e3ab5b1c115cbd8)

src/glu/sgi/libutil/mipmap.c

index 796be0a..bf6eaf8 100644 (file)
@@ -3608,6 +3608,7 @@ int gluBuild1DMipmapLevelsCore(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(newImage);
                    return GLU_OUT_OF_MEMORY;
                }
            }