Skip to content

Commit 70d7099

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 799fdb4 commit 70d7099

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

diff.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3485,11 +3485,13 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
34853485
if (start_command(&child) != 0 ||
34863486
strbuf_read(&buf, child.out, 0) < 0 ||
34873487
finish_command(&child) != 0) {
3488+
close(child.out);
34883489
if (temp.name == temp.tmp_path)
34893490
unlink(temp.name);
34903491
error("error running textconv command '%s'", pgm);
34913492
return NULL;
34923493
}
3494+
close(child.out);
34933495
if (temp.name == temp.tmp_path)
34943496
unlink(temp.name);
34953497

0 commit comments

Comments
 (0)