summaryrefslogtreecommitdiff
path: root/source3
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
commit5e7f809f8f2806f0315f81b109688b3e2ff8b950 (patch)
tree2df38e26fee8f2f51249ec58bb58d775aafc07f5 /source3
parentd2a85e518536796c69c689ded50cb6551d460f97 (diff)
downloadsamba-5e7f809f8f2806f0315f81b109688b3e2ff8b950.tar.gz
samba-5e7f809f8f2806f0315f81b109688b3e2ff8b950.tar.bz2
samba-5e7f809f8f2806f0315f81b109688b3e2ff8b950.zip
Fixed crash bug when calling tdb_unlockkeys() with no locked keys.
woot! (This used to be commit eb432700c0010e536be3a0703f152c533357b851)
Diffstat (limited to 'source3')
-rw-r--r--source3/tdb/tdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index ab50f40ef6..c414ae0d31 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);