summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-08-07 17:16:26 +1000
committerAndrew Tridgell <tridge@samba.org>2009-08-07 17:24:48 +1000
commit2c12c985e7f2debb25452e484925b7fdf987c659 (patch)
tree34f19490f099a0ae48082960ffe13e6ee40df72e /source4/dsdb/schema
parente2d4ae15107c8613707adc68ffc68c6ced04e9be (diff)
downloadsamba-2c12c985e7f2debb25452e484925b7fdf987c659.tar.gz
samba-2c12c985e7f2debb25452e484925b7fdf987c659.tar.bz2
samba-2c12c985e7f2debb25452e484925b7fdf987c659.zip
use talloc with the global schema consistently
Before this change, the first opener of the sam ldb context would become the owner of the global schema, then the autofree context got a reference to the schema. Any subsequent opens of the sam ldb also got a reference. This meant that the talloc hierarchy was inconsistent between the first sam ldb open and subsequent opens. With this change the autofree context becomes the owner of the global schema, and all ldb contexts get a reference.
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema_set.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 5ded04e9da..5d78d0a0c6 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -437,7 +437,8 @@ void dsdb_make_schema_global(struct ldb_context *ldb)
}
/* we want the schema to be around permanently */
- talloc_reference(talloc_autofree_context(), schema);
+ talloc_reparent(talloc_parent(schema), talloc_autofree_context(), schema);
+
global_schema = schema;
dsdb_set_global_schema(ldb);