From 0c5f2ba38e8e6d27dd35844e8268a9a26e614e06 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 7 Nov 2004 10:20:50 +0000 Subject: 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) --- source4/ntvfs/common/opendb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit