ldb:ldb_dn - "ldb_dn_explode" - move the "dn->comp_num" initalisation upwards and...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 19:59:37 +0000 (21:59 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 19:59:37 +0000 (21:59 +0200)
Mostly cosmetic - no behaviour change

source4/lib/ldb/common/ldb_dn.c

index 5ce735f145452f795b7e2a3efce7d6e151922f9d..e2ac9ad0bd82c6c1f07a776fc77e6ba4c3cac12d 100644 (file)
@@ -331,8 +331,9 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
                return true;
        }
 
-       /* make sure we free this if alloced previously before replacing */
-       talloc_free(dn->components);
+       /* make sure we free this if allocated previously before replacing */
+       LDB_FREE(dn->components);
+       dn->comp_num = 0;
 
        LDB_FREE(dn->ext_components);
        dn->ext_comp_num = 0;
@@ -343,7 +344,6 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
        if ( ! dn->components) {
                return false;
        }
-       dn->comp_num = 0;
 
        /* Components data space is allocated here once */
        data = talloc_array(dn->components, char, strlen(parse_dn) + 1);