aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-12-30 04:02:53 -0500
committerJunio C Hamano <gitster@pobox.com>2009-12-30 01:22:27 -0800
commit70d7099916c9621e157c620f9cc7fc982f109c55 (patch)
tree1e3d34205b9fd9581535a563a49ba24cccc5fa24 /diff.c
parent799fdb4ed0f9443122fdb85f6f73c58cb1de12ec (diff)
downloadgit-70d7099916c9621e157c620f9cc7fc982f109c55.tar.gz
git-70d7099916c9621e157c620f9cc7fc982f109c55.tar.xz
textconv: stop leaking file descriptors
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 387d19fde..69147b802 100644
--- a/diff.c
+++ b/diff.c
@@ -3485,11 +3485,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);
if (temp.name == temp.tmp_path)
unlink(temp.name);
error("error running textconv command '%s'", pgm);
return NULL;
}
+ close(child.out);
if (temp.name == temp.tmp_path)
unlink(temp.name);