s4:ldb_dn.c - make the code parts which free extended components consistent
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 20:04:24 +0000 (22:04 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 20:07:01 +0000 (22:07 +0200)
Cosmetic

source4/lib/ldb/common/ldb_dn.c

index e2ac9ad0bd82c6c1f07a776fc77e6ba4c3cac12d..c4805f7243b7eed0273125b83317d97eafcb69f0 100644 (file)
@@ -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)