From 35ccc108abcd6a783b685b16759f12813204636b Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 7 Mar 2006 00:25:10 +0000 Subject: [PATCH] - some error paths when reading GIF images weren't closing the GIF read object. (detected by valgrind) --- Changes | 2 ++ gif.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Changes b/Changes index be88b798..bc42d5d6 100644 --- a/Changes +++ b/Changes @@ -1391,6 +1391,8 @@ Revision history for Perl extension Imager. was leaking memory. (detected by valgrind) - writing to a PNG file was leaking one memory block (detected by valgrind) +- some error paths when reading GIF images weren't closing the GIF + read object. (detected by valgrind) ================================================================= diff --git a/gif.c b/gif.c index 3aa46d46..191f24cf 100644 --- a/gif.c +++ b/gif.c @@ -586,12 +586,14 @@ i_img **i_readgif_multi_low(GifFileType *GifFile, int *count, int page) { if (!i_int_check_image_file_limits(Width, Height, channels, sizeof(i_sample_t))) { free_images(results, *count); mm_log((1, "i_readgif: image size exceeds limits\n")); + DGifCloseFile(GifFile); myfree(GifRow); return NULL; } img = i_img_pal_new(Width, Height, channels, 256); if (!img) { free_images(results, *count); + DGifCloseFile(GifFile); return NULL; } /* populate the palette of the new image */ -- 2.39.5