aboutsummaryrefslogtreecommitdiffstats
path: root/progs
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-11-17 11:04:24 -0800
committerVinson Lee <[email protected]>2009-11-17 11:04:24 -0800
commit786d539511eb3c5a4101b11b7f8e90d60123ac46 (patch)
treed0257a84d3bee9ac3a222721414952fb8f638e96 /progs
parentb353106467d386b48877d6ae1048cca3feaf99ff (diff)
progs/util: Fix memory leak if malloc fails in tkRGBImageLoad.
Diffstat (limited to 'progs')
-rw-r--r--progs/util/readtex.c1
1 files changed, 1 insertions, 0 deletions
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;