Git development
 help / color / mirror / Atom feed
* [PATCH] textconv: stop leaking file descriptors
@ 2009-12-30  9:02 Jeff King
  0 siblings, 0 replies; only message in thread
From: Jeff King @ 2009-12-30  9:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

We read the output from textconv helpers over a pipe, but we
never actually closed our end of the pipe after using it.

Signed-off-by: Jeff King <peff@peff.net>
---
This should go onto 'maint'. Now I'll just go find a brown paper bag...

 diff.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/diff.c b/diff.c
index d14a575..aad4b39 100644
--- a/diff.c
+++ b/diff.c
@@ -3823,11 +3823,13 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
 	if (start_command(&child) != 0 ||
 	    strbuf_read(&buf, child.out, 0) < 0 ||
 	    finish_command(&child) != 0) {
+		close(child.out);
 		strbuf_release(&buf);
 		remove_tempfile();
 		error("error running textconv command '%s'", pgm);
 		return NULL;
 	}
+	close(child.out);
 	remove_tempfile();
 
 	return strbuf_detach(&buf, outsize);
-- 
1.6.6.320.g7c9b3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-30  9:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30  9:02 [PATCH] textconv: stop leaking file descriptors Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox