From: Martin Schwenke Date: Sat, 11 May 2019 04:24:24 +0000 (+1000) Subject: ctdb-recoverd: Fix memory leak X-Git-Tag: samba-4.11.0rc1~949 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=6a2941e2a9fd6ab2d5b8dbac042b61a7b1b0b914;p=samba.git ctdb-recoverd: Fix memory leak state is always freed before exiting this function, so allocate fde off it instead of long-lived ctdb context. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 9b3559b2a92..3e63bd1e7a5 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -1134,7 +1134,7 @@ static int helper_run(struct ctdb_recoverd *rec, TALLOC_CTX *mem_ctx, state->done = false; - fde = tevent_add_fd(rec->ctdb->ev, rec->ctdb, state->fd[0], + fde = tevent_add_fd(rec->ctdb->ev, state, state->fd[0], TEVENT_FD_READ, helper_handler, state); if (fde == NULL) { goto fail;