]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbindd: let setup_child() use a useful mem_ctx for talloc memory
authorStefan Metzmacher <metze@samba.org>
Fri, 7 Feb 2025 15:09:39 +0000 (16:09 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 8 Feb 2025 15:26:38 +0000 (15:26 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/winbindd/winbindd_dual.c

index a34232da430128149201fe6d9f7bfe717ea345f2..65794552d9dbc438f10955366b44b8c9064348a3 100644 (file)
@@ -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);
 }