fixed leaking file descriptors
authorMatthias Kramm <kramm@quiss.org>
Sun, 31 May 2009 13:59:37 +0000 (15:59 +0200)
committerMatthias Kramm <kramm@quiss.org>
Sun, 31 May 2009 13:59:37 +0000 (15:59 +0200)
lib/jpeg.c
lib/png.c

index 66882b0..24bf2ed 100644 (file)
@@ -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;
 }
 
index d71c19b..b74dfb0 100644 (file)
--- 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;
     }