From: Florian Forster Date: Thu, 21 Dec 2006 12:38:52 +0000 (+0100) Subject: Bug#404018: Close the file descriptor when binding to a socket fails. X-Git-Tag: collectd-3.10.4~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f763c933f11eeb07d4a159fc711190434439eef4;p=collectd.git Bug#404018: Close the file descriptor when binding to a socket fails. This closes the second part of the bug reported by Max Kellermann. --- diff --git a/src/network.c b/src/network.c index c233de68..e9ba84bb 100644 --- a/src/network.c +++ b/src/network.c @@ -284,6 +284,7 @@ int network_create_socket (const char *node, const char *service) { if (network_bind_socket (se, ai_ptr) != 0) { + close (se->fd); free (se->addr); free (se); continue;