From ffb5c2dacd895c84a9b989a5771fbfbce8254856 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Feb 2025 16:09:39 +0100 Subject: [PATCH] winbindd: let setup_child() use a useful mem_ctx for talloc memory Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source3/winbindd/winbindd_dual.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index a34232da430..65794552d9d 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -802,6 +802,7 @@ void setup_child(struct winbindd_domain *domain, struct winbindd_child *child, { const struct loadparm_substitution *lp_sub = loadparm_s3_global_substitution(); + TALLOC_CTX *mem_ctx = NULL; if (logprefix && logname) { char *logbase = NULL; @@ -834,13 +835,19 @@ void setup_child(struct winbindd_domain *domain, struct winbindd_child *child, "logname == NULL"); } + if (domain != NULL) { + mem_ctx = domain->children; + } else { + mem_ctx = child; + } + child->pid = 0; child->sock = -1; child->domain = domain; - child->queue = tevent_queue_create(NULL, "winbind_child"); + child->queue = tevent_queue_create(mem_ctx, "winbind_child"); SMB_ASSERT(child->queue != NULL); - child->binding_handle = wbint_binding_handle(NULL, NULL, child); + child->binding_handle = wbint_binding_handle(mem_ctx, NULL, child); SMB_ASSERT(child->binding_handle != NULL); } -- 2.47.2