Merge branch 'sb/gpg-plug-fd-leak'

We forgot to close the file descriptor reading from "gpg" output,
killing "git log --show-signature" on a long history.

* sb/gpg-plug-fd-leak:
  gpg: close stderr once finished with it in verify_signed_buffer()
maint
Junio C Hamano 2013-02-05 16:12:43 -08:00
commit 15778842bd
1 changed files with 3 additions and 1 deletions

View File

@ -130,8 +130,10 @@ int verify_signed_buffer(const char *payload, size_t payload_size,
write_in_full(gpg.in, payload, payload_size);
close(gpg.in);

if (gpg_output)
if (gpg_output) {
strbuf_read(gpg_output, gpg.err, 0);
close(gpg.err);
}
ret = finish_command(&gpg);

unlink_or_warn(path);