s4:auth/sam.c - change base context for the "tmp_ctx" context in "authsam_expand_nest...
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 4 Mar 2010 21:18:10 +0000 (22:18 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 4 Mar 2010 21:18:10 +0000 (22:18 +0100)
Better use the "res_sids_ctx" as base context for the "tmp_ctx" and not the
long-living "sam_ctx"/"ldb" context to prevent memory leaks.

source4/auth/sam.c

index 20efc3684ab512d01698b8e97dee9fe2d7076344..fc3e810ef7f5fe0546d476a695ccecae0e0d763c 100644 (file)
@@ -336,7 +336,7 @@ _PUBLIC_ NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx,
                ++(*num_res_sids);
        }
 
                ++(*num_res_sids);
        }
 
-       tmp_ctx = talloc_new(sam_ctx);
+       tmp_ctx = talloc_new(res_sids_ctx);
 
        ret = gendb_search(sam_ctx, tmp_ctx, NULL, &res, attrs,
                "objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));
 
        ret = gendb_search(sam_ctx, tmp_ctx, NULL, &res, attrs,
                "objectSid=%s", ldap_encode_ndr_dom_sid(tmp_ctx, sid));