git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* found a resource leak in file builtin-fast-export.c
@ 2009-07-09  7:57 Martin Ettl
  2009-07-09  8:31 ` Thomas Rast
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Ettl @ 2009-07-09  7:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

Hi,

i have checked the source base of git with the static code analyis tool cppcheck. It brougt up an issue in file 1.6.3.3/builtin-fast-export.c at line 447.

The tool printed the following waring:

[git-1.6.3.3/builtin-fast-export.c:447]: (error) Resource leak: f

I have attached a patch to resolve this.


Best regards

Ettl Martin

-- 
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

[-- Attachment #2: builtin-fast-export.c.patch --]
[-- Type: text/x-patch, Size: 387 bytes --]

--- git-1.6.3.3/builtin-fast-export.c	2009-06-22 08:24:25.000000000 +0200
+++ git-1.6.3.3/builtin-fast-export_new.c	2009-07-09 09:44:28.000000000 +0200
@@ -442,8 +442,9 @@ static void export_marks(char *file)
 		deco++;
 	}
 
-	if (ferror(f) || fclose(f))
+	if (ferror(f))
 		error("Unable to write marks file %s.", file);
+  	fclose(f);
 }
 
 static void import_marks(char *input_file)

^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <7v7hxyyfcg.fsf@alter.siamese.dyndns.org>]

end of thread, other threads:[~2009-07-24 16:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-09  7:57 found a resource leak in file builtin-fast-export.c Martin Ettl
2009-07-09  8:31 ` Thomas Rast
2009-07-09 11:04   ` Johannes Schindelin
2009-07-09 11:24     ` Thomas Rast
2009-07-09 11:30       ` Andreas Ericsson
2009-07-09 13:01       ` Johannes Schindelin
2009-07-09 13:28         ` [PATCH] Fix export_marks() error handling Matthias Andree
2009-07-11  9:45           ` Stephen R. van den Berg
2009-07-13  8:01             ` Matthias Andree
2009-07-09 13:36         ` found a resource leak in file builtin-fast-export.c Matthias Andree
     [not found] <7v7hxyyfcg.fsf@alter.siamese.dyndns.org>
2009-07-24  8:17 ` [PATCH] Fix export_marks() error handling Matthias Andree
2009-07-24 16:35   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).