提交 70d70999 编写于 作者: J Jeff King 提交者: Junio C Hamano

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: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 799fdb4e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册