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

(cherry picked from commit 786d539511)
This commit is contained in:
Vinson Lee 2009-11-17 11:04:24 -08:00
parent f1172c4030
commit 772e004781

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;