dsdb: reset schema->{classes,attributes}_to_remove_size to 0
[obnox/samba/samba-obnox.git] / source4 / dsdb / schema / schema_set.c
index 73264f9545a6906fcebbfacd67f83c0befabd969..ce8facbef3c9e62f0ad027cf9d435cff44b30098 100644 (file)
@@ -338,8 +338,10 @@ int dsdb_setup_sorted_accessors(struct ldb_context *ldb,
                TALLOC_FREE(schema->attributes_to_remove[i]);
        }
 
-       TALLOC_FREE(schema->attributes_to_remove);
        TALLOC_FREE(schema->classes_to_remove);
+       schema->classes_to_remove_size = 0;
+       TALLOC_FREE(schema->attributes_to_remove);
+       schema->attributes_to_remove_size = 0;
 
        /* free all caches */
        dsdb_sorted_accessors_free(schema);