From: Vinson Lee Date: Tue, 17 Nov 2009 19:04:24 +0000 (-0800) Subject: progs/util: Fix memory leak if malloc fails in tkRGBImageLoad. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=786d539511eb3c5a4101b11b7f8e90d60123ac46;p=mesa.git progs/util: Fix memory leak if malloc fails in tkRGBImageLoad. --- diff --git a/progs/util/readtex.c b/progs/util/readtex.c index ec27e20d681..c57b66bd9d3 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -250,6 +250,7 @@ static TK_RGBImageRec *tkRGBImageLoad(const char *fileName) final = (TK_RGBImageRec *)malloc(sizeof(TK_RGBImageRec)); if (final == NULL) { fprintf(stderr, "Out of memory!\n"); + RawImageClose(raw); return NULL; } final->sizeX = raw->sizeX;