From cc0e67015696ce625033e9b2d49142fabed19c7e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Nov 2004 10:50:13 +0000 Subject: r3635: fixed the crash from the BASE-DISCONNECT test (This used to be commit bdabb3f836d56ab0af9201321c00c8b385e053a5) --- source4/ntvfs/posix/pvfs_lock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c index a2691cb550..485199e6f8 100644 --- a/source4/ntvfs/posix/pvfs_lock.c +++ b/source4/ntvfs/posix/pvfs_lock.c @@ -188,6 +188,7 @@ static void pvfs_pending_lock_continue(void *private, enum pvfs_wait_notice reas if (pending->wait_handle == NULL) { pvfs_lock_async_failed(pvfs, req, f, locks, i, NT_STATUS_NO_MEMORY); } else { + talloc_steal(pending, pending->wait_handle); DLIST_ADD(f->pending_list, pending); } return; @@ -224,7 +225,6 @@ void pvfs_lock_close(struct pvfs_state *pvfs, struct pvfs_file *f) for (p=f->pending_list;p;p=next) { next = p->next; DLIST_REMOVE(f->pending_list, p); - talloc_free(p->wait_handle); p->req->async_states->status = NT_STATUS_RANGE_NOT_LOCKED; p->req->async_states->send_fn(p->req); } @@ -374,6 +374,7 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs, if (pending->wait_handle == NULL) { return NT_STATUS_NO_MEMORY; } + talloc_steal(pending, pending->wait_handle); DLIST_ADD(f->pending_list, pending); return NT_STATUS_OK; } -- cgit