glu/sgi: Fix memory leak in gluScaleImage3D.
authorVinson Lee <vlee@vmware.com>
Mon, 23 Nov 2009 05:57:37 +0000 (00:57 -0500)
committerVinson Lee <vlee@vmware.com>
Mon, 23 Nov 2009 05:57:37 +0000 (00:57 -0500)
src/glu/sgi/libutil/mipmap.c

index 4139c304a1dfaf11d21a12340d49c9b99b5284c2..223621f49fc8d0cde114318ffbd916b387d35537 100644 (file)
@@ -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);