From: Vinson Lee Date: Sun, 22 Nov 2009 06:57:35 +0000 (-0500) Subject: glu/sgi: Fix memory leak in gluScaleImage. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe38c16021694145b2c96818e0c0fb095e42c03b;p=mesa.git glu/sgi: Fix memory leak in gluScaleImage. (cherry picked from commit a9c540f5dedbf593f8038fdbc95eecb60826ab26) --- diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index af647af73c9..4139c304a1d 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -3526,6 +3526,8 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, afterImage = malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { + free(beforeImage); + free(afterImage); return GLU_OUT_OF_MEMORY; }