git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailsplit.c: remove dead code
@ 2014-08-11 21:11 Stefan Beller
  2014-08-12 16:38 ` René Scharfe
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Beller @ 2014-08-11 21:11 UTC (permalink / raw)
  To: gitster, git; +Cc: Stefan Beller

This was found by coverity. (Id: 290001)

the variable 'output' is only assigned to a value inequal to NUL,
after all gotos to the corrupt label.
Therefore we can conclude the two removed lines are actually dead code.

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
---
 builtin/mailsplit.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index 06296d4..b499014 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -93,8 +93,6 @@ static int split_one(FILE *mbox, const char *name, int allow_bare)
 	return status;
 
  corrupt:
-	if (output)
-		fclose(output);
 	unlink(name);
 	fprintf(stderr, "corrupt mailbox\n");
 	exit(1);
-- 
2.1.0.rc2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-08-17  8:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11 21:11 [PATCH] mailsplit.c: remove dead code Stefan Beller
2014-08-12 16:38 ` René Scharfe
2014-08-12 21:21   ` Stefan Beller
2014-08-12 21:37     ` Matthieu Moy
2014-08-12 21:38       ` Junio C Hamano
2014-08-12 21:50         ` Junio C Hamano
2014-08-12 21:56         ` Matthieu Moy
2014-08-12 22:58     ` Jonathan Nieder
2014-08-17  8:14   ` Jeff King

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).