mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
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>
This commit is contained in:
parent
799fdb4ed0
commit
70d7099916
2
diff.c
2
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user