gpg: close stderr once finished with it in verify_signed_buffer()
commit7dac3f83218b9f6c4c7d1c1cf093190f20d27108
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 31 Jan 2013 18:18:40 +0000 (31 10:18 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 31 Jan 2013 19:10:44 +0000 (31 11:10 -0800)
tree7c70a82ddb09f2d9b5aa4b2ba26061efd4759f74
parent2f47eae2a1337bd0cb50dbc936df6433f460bb4a
gpg: close stderr once finished with it in verify_signed_buffer()

Failing to close the stderr pipe in verify_signed_buffer() causes
git to run out of file descriptors if there are many calls to
verify_signed_buffer(). An easy way to trigger this is to run

 git log --show-signature --merges | grep "key"

on the linux kernel git repo. Eventually it will fail with

 error: cannot create pipe for gpg: Too many open files
 error: could not run gpg.

Close the stderr pipe so that this can't happen.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gpg-interface.c