From f2f51a45e4938ab18930aa4ba717da8e083e0b5e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Oct 2015 15:57:42 +0200 Subject: [PATCH] s3:ctdbd_conn: make sure we destroy tevent_fd before closing the socket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Reviewed-by: Günther Deschner (cherry picked from commit 70dbba96e311449575f571db68710584fc991234) --- source3/lib/ctdbd_conn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index a26f410..94a3cdea 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -498,7 +498,11 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid, static int ctdbd_connection_destructor(struct ctdbd_connection *c) { - close(c->fd); + TALLOC_FREE(c->fde); + if (c->fd != -1) { + close(c->fd); + c->fd = -1; + } return 0; } /* -- 1.9.1