1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ctdb-server: fix a possible fd leak in ctdb_tcp_listen_automatic()

sockets are created in a loop until an unused address is found.
But the unused socket fds were not closed.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Michael Adam 2015-09-08 10:01:31 +02:00 committed by Martin Schwenke
parent 4010c03e3d
commit 7d49d9b4a1

View File

@ -338,6 +338,8 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
DEBUG(DEBUG_ERR,(__location__ " Failed to bind() to socket. %s(%d)\n",
strerror(errno), errno));
}
close(ctcp->listen_fd);
}
if (i == ctdb->num_nodes) {