summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-07 10:20:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:37 -0500
commit0c5f2ba38e8e6d27dd35844e8268a9a26e614e06 (patch)
tree3d34f6b69919ccf545009611bd4b6f9f829679fa /source4
parent8e7f33e93df9557228d17a50b83b7abd9c8fdd43 (diff)
downloadsamba-0c5f2ba38e8e6d27dd35844e8268a9a26e614e06.tar.gz
samba-0c5f2ba38e8e6d27dd35844e8268a9a26e614e06.tar.bz2
samba-0c5f2ba38e8e6d27dd35844e8268a9a26e614e06.zip
r3597: implement a suggestion from abartlet. By taking a refernce to the
database in the opendb lck, we ensure that the database is not closed before the lock is gone. That ensures the lock destructor doesn't work on a closed database. (This used to be commit 218e01441aa1def3e8e884c8d618a95c9ffdfc1b)
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/common/opendb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c
index bed4910be4..a1d4ed1ddb 100644
--- a/source4/ntvfs/common/opendb.c
+++ b/source4/ntvfs/common/opendb.c
@@ -130,7 +130,7 @@ struct odb_lock *odb_lock(TALLOC_CTX *mem_ctx,
return NULL;
}
- lck->odb = odb;
+ lck->odb = talloc_reference(lck, odb);
lck->key.dptr = talloc_memdup(lck, file_key->data, file_key->length);
lck->key.dsize = file_key->length;
if (lck->key.dptr == NULL) {