From: Jeff King Date: Wed, 30 Dec 2009 09:02:53 +0000 (-0500) Subject: textconv: stop leaking file descriptors X-Git-Tag: v1.6.6.1~21^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/70d7099916c9621e157c620f9cc7fc982f109c55?ds=inline;hp=--cc 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 Signed-off-by: Junio C Hamano --- 70d7099916c9621e157c620f9cc7fc982f109c55 diff --git a/diff.c b/diff.c index 387d19fded..69147b802f 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);