summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-29 22:04:24 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-29 22:07:01 +0200
commit0f0d9aa9b5959a12385c2b79d7dd35e9d081033c (patch)
treed47ce1d89cdd7517afbc7785e0fa117537fc4d13
parent1e04f49ddbfaa002ba930f2b79883ed3688e1ea8 (diff)
downloadsamba-0f0d9aa9b5959a12385c2b79d7dd35e9d081033c.tar.gz
samba-0f0d9aa9b5959a12385c2b79d7dd35e9d081033c.tar.bz2
samba-0f0d9aa9b5959a12385c2b79d7dd35e9d081033c.zip
s4:ldb_dn.c - make the code parts which free extended components consistent
Cosmetic
-rw-r--r--source4/lib/ldb/common/ldb_dn.c16
1 files changed, 7 insertions, 9 deletions
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)