From: Vinson Lee Date: Mon, 23 Nov 2009 05:57:37 +0000 (-0500) Subject: glu/sgi: Fix memory leak in gluScaleImage3D. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b611f639b4bffdcca376293f7ce71af9f6bdbff3;p=mesa.git glu/sgi: Fix memory leak in gluScaleImage3D. --- diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 4139c304a1d..223621f49fc 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -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);