s4: schema: Allocate global_schema off the NULL context, not the talloc_autofree_cont...
authorJeremy Allison <jra@samba.org>
Mon, 24 Jul 2017 19:50:50 +0000 (12:50 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 26 Jul 2017 19:35:22 +0000 (21:35 +0200)
The ldb context keeps a talloc_reference to this also, so the long-live allocation
context can be NULL.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/schema/schema_set.c

index df27e19a944a72894b7285dff072fd382b0016ff..28bedb308953cd5e88fe699c424b5194f97f2d7a 100644 (file)
@@ -714,11 +714,11 @@ void dsdb_make_schema_global(struct ldb_context *ldb, struct dsdb_schema *schema
        }
 
        if (global_schema) {
-               talloc_unlink(talloc_autofree_context(), global_schema);
+               talloc_unlink(NULL, global_schema);
        }
 
        /* we want the schema to be around permanently */
-       talloc_reparent(ldb, talloc_autofree_context(), schema);
+       talloc_reparent(ldb, NULL, schema);
        global_schema = schema;
 
        /* This calls the talloc_reference() of the global schema back onto the ldb */