summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/schema/schema_set.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 53bfa72ff3..8cb06bb70e 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -321,6 +321,7 @@ int dsdb_setup_sorted_accessors(struct ldb_context *ldb,
struct dsdb_attribute *a;
unsigned int i;
unsigned int num_int_id;
+ int ret;
/* free all caches */
dsdb_sorted_accessors_free(schema);
@@ -405,6 +406,12 @@ int dsdb_setup_sorted_accessors(struct ldb_context *ldb,
dsdb_setup_attribute_shortcuts(ldb, schema);
+ ret = schema_fill_constructed(schema);
+ if (ret != LDB_SUCCESS) {
+ dsdb_sorted_accessors_free(schema);
+ return ret;
+ }
+
return LDB_SUCCESS;
failed:
@@ -426,11 +433,6 @@ int dsdb_set_schema(struct ldb_context *ldb, struct dsdb_schema *schema)
return ret;
}
- ret = schema_fill_constructed(schema);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
-
old_schema = ldb_get_opaque(ldb, "dsdb_schema");
ret = ldb_set_opaque(ldb, "dsdb_schema", schema);