summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tdb/common/dump.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tdb/common/dump.c b/lib/tdb/common/dump.c
index 5f6a78b2c8e..73286b87350 100644
--- a/lib/tdb/common/dump.c
+++ b/lib/tdb/common/dump.c
@@ -62,7 +62,11 @@ static int tdb_dump_chain(struct tdb_context *tdb, int i)
{
tdb_off_t rec_ptr, top;
- top = TDB_HASH_TOP(i);
+ if (i == -1) {
+ top = FREELIST_TOP;
+ } else {
+ top = TDB_HASH_TOP(i);
+ }
if (tdb_lock(tdb, i, F_WRLCK) != 0)
return -1;