diff options
author | Amitay Isaacs <amitay@gmail.com> | 2019-05-13 17:07:59 +1000 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2019-05-17 10:56:19 +0000 |
commit | 8b523259855edcc9350cbb1ee62b4a2156fab539 (patch) | |
tree | 149f2342dfa78fa9345740e53a9861d6b7451114 /ctdb | |
parent | 5419978537665cbe2233f57f3f289d3843935318 (diff) | |
download | samba-8b523259855edcc9350cbb1ee62b4a2156fab539.tar.gz |
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)
Autobuild-User(v4-9-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-9-test): Fri May 17 10:56:19 UTC 2019 on sn-devel-144
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/common/run_proc.c | 7 |
1 files 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); } |