The Samba-Bugzilla – Attachment 15154 Details for
Bug 13943
CTDB recovery daemon and event daemon leak memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.9 and 4.10
BZ13943.patch (text/plain), 3.25 KB, created by
Martin Schwenke
on 2019-05-15 02:12:23 UTC
(
hide
)
Description:
Patch for 4.9 and 4.10
Filename:
MIME Type:
Creator:
Martin Schwenke
Created:
2019-05-15 02:12:23 UTC
Size:
3.25 KB
patch
obsolete
>From 20da5d5286feb70737c5f6bc2ea000f79be0457a Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Sat, 11 May 2019 14:24:24 +1000 >Subject: [PATCH 1/3] 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 <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> >(cherry picked from commit 6a2941e2a9fd6ab2d5b8dbac042b61a7b1b0b914) >--- > ctdb/server/ctdb_recoverd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >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; >-- >2.20.1 > > >From 9cc73c26903b4d555fb5332f6e7a88f59cec7fd8 Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Sat, 11 May 2019 17:33:57 +1000 >Subject: [PATCH 2/3] ctdb-common: Fix memory leak > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943 > >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Amitay Isaacs <amitay@gmail.com> >(cherry picked from commit 30bc6e2529cdd444d4ec7902844c3a6fb0858090) >--- > ctdb/common/event_script.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/ctdb/common/event_script.c b/ctdb/common/event_script.c >index 8978d1452c0..8bdfdd0b5ca 100644 >--- a/ctdb/common/event_script.c >+++ b/ctdb/common/event_script.c >@@ -117,7 +117,8 @@ int event_script_get_list(TALLOC_CTX *mem_ctx, > } > > *out = script_list; >- return 0; >+ ret = 0; >+ goto done; > > nomem: > ret = ENOMEM; >-- >2.20.1 > > >From 567bfa62066981ada6e37d8ce83c143854989c42 Mon Sep 17 00:00:00 2001 >From: Amitay Isaacs <amitay@gmail.com> >Date: Mon, 13 May 2019 17:07:59 +1000 >Subject: [PATCH 3/3] ctdb-common: Fix memory leak in run_proc > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13943 > >Signed-off-by: Amitay Isaacs <amitay@gmail.com> >Reviewed-by: Martin Schwenke <martin@meltin.net> > >Autobuild-User(master): Amitay Isaacs <amitay@samba.org> >Autobuild-Date(master): Tue May 14 08:59:03 UTC 2019 on sn-devel-184 > >(cherry picked from commit b1f4c86eea022999d5439e4a6ef3494fe41479b6) >--- > ctdb/common/run_proc.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/ctdb/common/run_proc.c b/ctdb/common/run_proc.c >index 037b6d9651d..0c3c1de72fe 100644 >--- a/ctdb/common/run_proc.c >+++ b/ctdb/common/run_proc.c >@@ -302,13 +302,15 @@ again: > proc->fd = -1; > } > >+ DLIST_REMOVE(run_ctx->plist, proc); >+ > /* Active run_proc request */ > if (proc->req != NULL) { > run_proc_done(proc->req); >+ } else { >+ talloc_free(proc); > } > >- DLIST_REMOVE(run_ctx->plist, proc); >- > goto again; > } > >@@ -426,6 +428,7 @@ static void run_proc_done(struct tevent_req *req) > if (state->proc->output != NULL) { > state->output = talloc_steal(state, state->proc->output); > } >+ talloc_steal(state, state->proc); > > tevent_req_done(req); > } >-- >2.20.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
amitay
:
review+
Actions:
View
Attachments on
bug 13943
: 15154