From: Matthias Kramm Date: Sun, 31 May 2009 13:59:37 +0000 (+0200) Subject: fixed leaking file descriptors X-Git-Tag: version-0-9-1~341 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=8e7368c8b06e0a916fa82c44ea22172075a7ef4c fixed leaking file descriptors --- diff --git a/lib/jpeg.c b/lib/jpeg.c index 66882b0..24bf2ed 100644 --- a/lib/jpeg.c +++ b/lib/jpeg.c @@ -362,6 +362,7 @@ int jpeg_load(const char*filename, unsigned char**dest, int*_width, int*_height) jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); + fclose(fi); return 1; } diff --git a/lib/png.c b/lib/png.c index d71c19b..b74dfb0 100644 --- a/lib/png.c +++ b/lib/png.c @@ -486,6 +486,7 @@ EXPORT int getPNG(const char*sname, int*destwidth, int*destheight, unsigned char } if(!png_read_header(fi, &header)) { + fclose(fi); return 0; }