Bug#404018: Close the file descriptor when binding to a socket fails.
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 21 Dec 2006 12:38:52 +0000 (13:38 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 21 Dec 2006 19:18:09 +0000 (20:18 +0100)
This closes the second part of the bug reported by Max Kellermann.

src/network.c

index c233de6..e9ba84b 100644 (file)
@@ -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;