git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4010c03
)
ctdb-server: fix a possible fd leak in ctdb_tcp_listen_automatic()
author
Michael Adam
<obnox@samba.org>
Tue, 8 Sep 2015 08:01:31 +0000
(10:01 +0200)
committer
Martin Schwenke
<martins@samba.org>
Wed, 9 Sep 2015 08:12:21 +0000
(10:12 +0200)
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>
ctdb/tcp/tcp_connect.c
patch
|
blob
|
history
diff --git
a/ctdb/tcp/tcp_connect.c
b/ctdb/tcp/tcp_connect.c
index b106f22c86fa51dae72428e03696f3a8881fd29c..277eb375ba9c61df586915ace9e7c926a7680b64 100644
(file)
--- a/
ctdb/tcp/tcp_connect.c
+++ b/
ctdb/tcp/tcp_connect.c
@@
-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) {