progs/util: Fix memory leak if malloc fails in tkRGBImageLoad.

This commit is contained in:
Vinson Lee
2009-11-17 11:04:24 -08:00
parent b353106467
commit 786d539511
+1
View File
@@ -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;