summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/common/ldb_dn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 5ce735f145..e2ac9ad0bd 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -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);