summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/tdb/common/traverse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/tdb/common/traverse.c b/source4/lib/tdb/common/traverse.c
index 00fe5be923..dc1060c6d0 100644
--- a/source4/lib/tdb/common/traverse.c
+++ b/source4/lib/tdb/common/traverse.c
@@ -173,6 +173,7 @@ static int tdb_traverse_internal(struct tdb_context *tdb,
/* Drop chain lock, call out */
if (tdb_unlock(tdb, tl->hash, tl->lock_rw) != 0) {
ret = -1;
+ SAFE_FREE(key.dptr);
goto out;
}
if (fn && fn(tdb, key, dbuf, private)) {
@@ -182,9 +183,8 @@ static int tdb_traverse_internal(struct tdb_context *tdb,
TDB_LOG((tdb, 0, "tdb_traverse: unlock_record failed!\n"));;
ret = -1;
}
- tdb->travlocks.next = tl->next;
SAFE_FREE(key.dptr);
- return count;
+ goto out;
}
SAFE_FREE(key.dptr);
}