[PATCH] Patch for bug 12485

Ralph Böhme slow at samba.org
Tue Dec 27 14:55:32 UTC 2016


Hi!

Just came across this one, sorry for not spotting it in the review!

Please review&push if ok. Thanks!

Cheerio!
-slow
-------------- next part --------------
From 27718ac958298d8cb0deb2d6e2606d1471c5c49c Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
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 <slow at samba.org>
---
 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 9614db6295421ab7705581286cdeb71f2fa4605b Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
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 <slow at samba.org>
---
 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



More information about the samba-technical mailing list