File-descriptor leak in 1.4.0 hkp retrieval

David Shaw dshaw at
Tue Feb 1 21:52:37 CET 2005

On Tue, Feb 01, 2005 at 04:22:37PM +0100, Phil Pennock wrote:

> gpgkeys: HKP fetch error: Too many open files
> -----------------------------< cut here >-------------------------------
> Looking at the code, it seems that in keyserver/gpgkeys_hkp.c in
> get_key(), there's a missing call to http_close(&hd) which appears to
> belong at the end of the function.

The missing http_close is certainly wrong, though due to interesting
circumstances that isn't the leak in this case.  The http code is
actually closing the socket automatically when we reach the end of the
read.  However, the http_close should still be there.

The leak is in the new joined ipv4/ipv6 getaddrinfo code.  Some of the
addresses in the rotation are down, and we leak a fd
each time we hit one.  I've fixed this in CVS.  Thanks for the report!


More information about the Gnupg-devel mailing list