From a30625306d1cdfad74ac27fd677ba38d0ca338fb Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 8 Aug 2009 10:44:09 +0200 Subject: [PATCH] fnt2bdf: Fixed 2 resource leaks. --- tools/fnt2bdf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/fnt2bdf.c b/tools/fnt2bdf.c index 277764b4ef4..f9f6647354a 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;