From 0f0d9aa9b5959a12385c2b79d7dd35e9d081033c Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 29 Jun 2010 22:04:24 +0200 Subject: s4:ldb_dn.c - make the code parts which free extended components consistent Cosmetic --- source4/lib/ldb/common/ldb_dn.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'source4/lib/ldb') diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index e2ac9ad0bd..c4805f7243 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -1431,9 +1431,9 @@ bool ldb_dn_add_base(struct ldb_dn *dn, struct ldb_dn *base) /* Wipe the ext_linearized DN, * the GUID and SID are almost certainly no longer valid */ LDB_FREE(dn->ext_linearized); - LDB_FREE(dn->ext_components); dn->ext_comp_num = 0; + return true; } @@ -1559,7 +1559,6 @@ bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child) /* Wipe the ext_linearized DN, * the GUID and SID are almost certainly no longer valid */ LDB_FREE(dn->ext_linearized); - LDB_FREE(dn->ext_components); dn->ext_comp_num = 0; @@ -1635,7 +1634,6 @@ bool ldb_dn_remove_base_components(struct ldb_dn *dn, unsigned int num) /* Wipe the ext_linearized DN, * the GUID and SID are almost certainly no longer valid */ LDB_FREE(dn->ext_linearized); - LDB_FREE(dn->ext_components); dn->ext_comp_num = 0; @@ -1680,9 +1678,9 @@ bool ldb_dn_remove_child_components(struct ldb_dn *dn, unsigned int num) /* Wipe the ext_linearized DN, * the GUID and SID are almost certainly no longer valid */ LDB_FREE(dn->ext_linearized); - LDB_FREE(dn->ext_components); dn->ext_comp_num = 0; + return true; } @@ -1703,9 +1701,9 @@ struct ldb_dn *ldb_dn_get_parent(void *mem_ctx, struct ldb_dn *dn) /* Wipe the ext_linearized DN, * the GUID and SID are almost certainly no longer valid */ LDB_FREE(dn->ext_linearized); - LDB_FREE(dn->ext_components); dn->ext_comp_num = 0; + return new_dn; } @@ -1877,9 +1875,9 @@ int ldb_dn_set_component(struct ldb_dn *dn, int num, /* Wipe the ext_linearized DN, * the GUID and SID are almost certainly no longer valid */ LDB_FREE(dn->ext_linearized); - - dn->ext_comp_num = 0; LDB_FREE(dn->ext_components); + dn->ext_comp_num = 0; + return LDB_SUCCESS; } @@ -1983,9 +1981,9 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn, void ldb_dn_remove_extended_components(struct ldb_dn *dn) { - dn->ext_comp_num = 0; - LDB_FREE(dn->ext_components); LDB_FREE(dn->ext_linearized); + LDB_FREE(dn->ext_components); + dn->ext_comp_num = 0; } bool ldb_dn_is_valid(struct ldb_dn *dn) -- cgit