From: Vinson Lee Date: Tue, 17 Nov 2009 21:49:31 +0000 (-0800) Subject: progs/util: Fix memory leak if fopen fails in RawImageOpen. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=305d4f147ea86d87706dbaf2caad6a131c59fe80;p=mesa.git progs/util: Fix memory leak if fopen fails in RawImageOpen. (cherry picked from commit d9508e8df9da4aa13bc223194c406081738bac91) --- diff --git a/progs/util/readtex.c b/progs/util/readtex.c index c57b66bd9d3..3922998fd5b 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -109,6 +109,7 @@ static rawImageRec *RawImageOpen(const char *fileName) raw->file = fopen(baseName + 1, "rb"); if(raw->file == NULL) { perror(fileName); + free(raw); return NULL; } }