From 5e7f809f8f2806f0315f81b109688b3e2ff8b950 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 13 Mar 2003 05:52:49 +0000 Subject: [PATCH] Fixed crash bug when calling tdb_unlockkeys() with no locked keys. woot! (This used to be commit eb432700c0010e536be3a0703f152c533357b851) --- source3/tdb/tdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c index ab50f40ef6e..c414ae0d310 100644 --- a/source3/tdb/tdb.c +++ b/source3/tdb/tdb.c @@ -1954,6 +1954,8 @@ int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]) void tdb_unlockkeys(TDB_CONTEXT *tdb) { u32 i; + if (!tdb->lockedkeys) + return; for (i = 0; i < tdb->lockedkeys[0]; i++) tdb_unlock(tdb, tdb->lockedkeys[i+1], F_WRLCK); SAFE_FREE(tdb->lockedkeys); -- 2.34.1