summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/tdb/tdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index 5d70c046d3..f07f474716 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -1397,6 +1397,7 @@ int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private_val)
/* Drop chain lock, call out */
if (tdb_unlock(tdb, tl.hash, F_WRLCK) != 0) {
ret = -1;
+ SAFE_FREE(key.dptr);
goto out;
}
if (fn && fn(tdb, key, dbuf, private_val)) {
@@ -1406,9 +1407,8 @@ int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private_val)
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);
}