summaryrefslogtreecommitdiff
path: root/ctdb/common/run_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/common/run_proc.c')
-rw-r--r--ctdb/common/run_proc.c7
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);
}