summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c1
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index a11f137cc9..18d51d1aa4 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -266,7 +266,6 @@ int ltdb_has_wildcard(struct ldb_context *ldb, const char *attr_name,
void ltdb_search_dn1_free(struct ldb_context *ldb, struct ldb_message *msg)
{
unsigned int i;
- ldb_free(ldb, msg->dn);
ldb_free(ldb, msg->private_data);
for (i=0;i<msg->num_elements;i++) {
ldb_free(ldb, msg->elements[i].values);
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 934ec68958..3d136ea014 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -608,7 +608,6 @@ static int ltdb_rename(struct ldb_context *ldb, const char *olddn, const char *n
goto failed;
}
- ldb_free(ldb, msg.dn);
msg.dn = ldb_strdup(ldb,newdn);
if (!msg.dn) {
ltdb_search_dn1_free(ldb, &msg);
@@ -617,9 +616,11 @@ static int ltdb_rename(struct ldb_context *ldb, const char *olddn, const char *n
ret = ltdb_add(ldb, &msg);
if (ret == -1) {
+ ldb_free(ldb, msg.dn);
ltdb_search_dn1_free(ldb, &msg);
goto failed;
}
+ ldb_free(ldb, msg.dn);
ltdb_search_dn1_free(ldb, &msg);
ret = ltdb_delete(ldb, olddn);