From 8e7368c8b06e0a916fa82c44ea22172075a7ef4c Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Sun, 31 May 2009 15:59:37 +0200 Subject: [PATCH] fixed leaking file descriptors --- lib/jpeg.c | 1 + lib/png.c | 1 + 2 files changed, 2 insertions(+) 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; } -- 1.7.10.4