summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-03-13 05:52:49 +0000
committerTim Potter <tpot@samba.org>2003-03-13 05:52:49 +0000
commiteb432700c0010e536be3a0703f152c533357b851 (patch)
tree5c4e78939c493b73419e79e0adf5561277ac532e
parentd40e3747cfa2994349aa84568f7b79457341a058 (diff)
downloadsamba-eb432700c0010e536be3a0703f152c533357b851.tar.gz
samba-eb432700c0010e536be3a0703f152c533357b851.tar.xz
samba-eb432700c0010e536be3a0703f152c533357b851.zip
Fixed crash bug when calling tdb_unlockkeys() with no locked keys.
woot!
-rw-r--r--source/tdb/tdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/tdb/tdb.c b/source/tdb/tdb.c
index ab50f40ef6e..c414ae0d310 100644
--- a/source/tdb/tdb.c
+++ b/source/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);