{"thread":{"id":"22060","subject":"[PATCH] textconv: stop leaking file descriptors","startedAt":"2009-12-30T09:02:53Z","lastAt":"2009-12-30T09:02:53Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"130531","messageId":"20091230090253.GA24049@coredump.intra.peff.net","threadId":"22060","inReplyTo":null,"subject":"[PATCH] textconv: stop leaking file descriptors","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-12-30T09:02:53Z","receivedAt":"2009-12-30T09:02:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We read the output from textconv helpers over a pipe, but we\nnever actually closed our end of the pipe after using it.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis should go onto 'maint'. Now I'll just go find a brown paper bag...\n\n diff.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex d14a575..aad4b39 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -3823,11 +3823,13 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,\n \tif (start_command(&child) != 0 ||\n \t    strbuf_read(&buf, child.out, 0) < 0 ||\n \t    finish_command(&child) != 0) {\n+\t\tclose(child.out);\n \t\tstrbuf_release(&buf);\n \t\tremove_tempfile();\n \t\terror(\"error running textconv command '%s'\", pgm);\n \t\treturn NULL;\n \t}\n+\tclose(child.out);\n \tremove_tempfile();\n \n \treturn strbuf_detach(&buf, outsize);\n-- \n1.6.6.320.g7c9b3\n"}]}