@matheusbsbs / matheus-bagliano / commits / 70d7099916
Fork 0

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>

Jeff King committed Dec 30, 2009 at 04:02 UTC 70d7099916c9621e157c620f9cc7fc982f109c55
1 file changed +2
diff.c
+2
@@ -3485,11 +3485,13 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
3485 if (start_command(&child) != 0 ||
3486 strbuf_read(&buf, child.out, 0) < 0 ||
3487 finish_command(&child) != 0) {
3488 + close(child.out);
3489 if (temp.name == temp.tmp_path)
3490 unlink(temp.name);
3491 error("error running textconv command '%s'", pgm);
3492 return NULL;
3493 }
3494 + close(child.out);
3495 if (temp.name == temp.tmp_path)
3496 unlink(temp.name);
3497