Marcus Meissner : fnt2bdf: Fixed 2 resource leaks.

Alexandre Julliard julliard at winehq.org
Mon Aug 10 10:34:59 CDT 2009


Module: wine
Branch: master
Commit: a30625306d1cdfad74ac27fd677ba38d0ca338fb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a30625306d1cdfad74ac27fd677ba38d0ca338fb

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sat Aug  8 10:44:09 2009 +0200

fnt2bdf: Fixed 2 resource leaks.

---

 tools/fnt2bdf.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/fnt2bdf.c b/tools/fnt2bdf.c
index 277764b..f9f6647 100644
--- a/tools/fnt2bdf.c
+++ b/tools/fnt2bdf.c
@@ -216,7 +216,10 @@ static int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
     }
 
     ic = dump_bdf_hdr(fp, cpe_font_struct, file_buffer);
-    if (ic) return (ic);
+    if (ic) {
+      fclose(fp);
+      return (ic);
+    }
 
     /* NOW, convert all chars to UNIX (lton) notation... */
 
@@ -544,7 +547,7 @@ int main(int argc, char **argv)
 
   parse_options( argc, argv);
 
-  if( (fd = open( g_lpstrInputFile, O_RDONLY | O_BINARY)) )
+  if( (fd = open( g_lpstrInputFile, O_RDONLY | O_BINARY)) != -1 )
   {
     int    i;
     struct stat file_stat;




More information about the wine-cvs mailing list