1. Stefan Saasen
  2. git

Commits

Jeff King  committed 70d7099

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>

  • Participants
  • Parent commits 799fdb4
  • Branches master

Comments (0)

Files changed (1)

File diff.c

View file
 	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);