From dd3868a5c76cc6d177c393215c6755d1b42d74a6 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 27 Dec 2016 09:19:16 +0100 Subject: [PATCH 1/2] ctdbd_conn: fix a resource leak When reinitializing the ctdb messaging subsystem we must free the ctdb connection fde. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12485 Signed-off-by: Ralph Boehme Reviewed-by: David Disseldorp --- source3/lib/messages_ctdbd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/lib/messages_ctdbd.c b/source3/lib/messages_ctdbd.c index 5964894..bee2685 100644 --- a/source3/lib/messages_ctdbd.c +++ b/source3/lib/messages_ctdbd.c @@ -183,6 +183,8 @@ static int messaging_ctdbd_init_internal(struct messaging_context *msg_ctx, int ret, ctdb_fd; if (reinit) { + TALLOC_FREE(ctx->fde); + ret = ctdbd_reinit_connection(ctx, lp_ctdbd_socket(), lp_ctdb_timeout(), -- 2.7.4 From bdaa2bcc1dd768d27d3696de23c1e9c6084d58d3 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 27 Dec 2016 15:41:51 +0100 Subject: [PATCH 2/2] ctdbd_conn: remove unused fde from struct ctdbd_connection BUG: https://bugzilla.samba.org/show_bug.cgi?id=12485 Signed-off-by: Ralph Boehme Reviewed-by: David Disseldorp --- source3/lib/ctdbd_conn.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 118f3a0..d16796f 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -50,7 +50,6 @@ struct ctdbd_connection { uint64_t rand_srvid; struct ctdbd_srvid_cb *callbacks; int fd; - struct tevent_fd *fde; int timeout; }; @@ -394,7 +393,6 @@ static int ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid, static int ctdbd_connection_destructor(struct ctdbd_connection *c) { - TALLOC_FREE(c->fde); if (c->fd != -1) { close(c->fd); c->fd = -1; -- 2.7.4