summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2009-11-17 11:04:24 -0800
committerVinson Lee <vlee@vmware.com>2009-12-03 16:57:17 -0800
commit772e00478124074c7b954fad52974057f0669a9b (patch)
tree08ca7fa8f3366777f0f976fd17900ca3a5444ecb /progs
parentf1172c4030dd0952dfdecda059beb39b1224a8ae (diff)
progs/util: Fix memory leak if malloc fails in tkRGBImageLoad.
(cherry picked from commit 786d539511eb3c5a4101b11b7f8e90d60123ac46)
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 ec27e20d68..c57b66bd9d 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;