From 325dace7e2a0ae1f4d477416e9e8f05f7c843fdf Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 1 Apr 2013 16:09:59 +0200 Subject: Do not keep growing event context --- src/util/child_common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/util') diff --git a/src/util/child_common.c b/src/util/child_common.c index 5f0b26595..a42d3a420 100644 --- a/src/util/child_common.c +++ b/src/util/child_common.c @@ -172,6 +172,8 @@ static void sss_child_invoke_cb(struct tevent_context *ev, if (child_ctx->cb) { child_ctx->cb(child_ctx->pid, cb_pvt->wait_status, child_ctx->pvt); } + + talloc_free(imm); } void sss_child_handler(struct tevent_context *ev, @@ -211,7 +213,7 @@ void sss_child_handler(struct tevent_context *ev, if (error == HASH_SUCCESS) { child_ctx = talloc_get_type(value.ptr, struct sss_child_ctx); - imm = tevent_create_immediate(sigchld_ctx->ev); + imm = tevent_create_immediate(child_ctx); if (imm == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory invoking SIGCHLD callback\n")); @@ -555,13 +557,13 @@ void child_sig_handler(struct tevent_context *ev, /* Invoke the callback in a tevent_immediate handler * so that it is safe to free the tevent_signal * */ - imm = tevent_create_immediate(ev); + imm = tevent_create_immediate(child_ctx); if (imm == NULL) { DEBUG(0, ("Out of memory invoking sig handler callback\n")); return; } - tevent_schedule_immediate(imm, ev,child_invoke_callback, + tevent_schedule_immediate(imm, ev, child_invoke_callback, child_ctx); } -- cgit