From 47b91c97cd5ec323b9c3b73bfa7951f8105da732 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Nov 2004 02:12:57 +0000 Subject: r3631: a couple of tweaks to the talloc hierarchy for async requests in pvfs. This prevents a possible crash due to free ordering on unexpected disconnect. (This used to be commit bfca9eb7cb7a2caf3a232d538808ff2ade8e1ca9) --- source4/ntvfs/posix/pvfs_open.c | 2 ++ source4/ntvfs/posix/pvfs_wait.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index cfd2b0f159..cc4498eee1 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -669,6 +669,8 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs, return NT_STATUS_NO_MEMORY; } + talloc_steal(pvfs, r); + return NT_STATUS_OK; } diff --git a/source4/ntvfs/posix/pvfs_wait.c b/source4/ntvfs/posix/pvfs_wait.c index 968f659421..479d339592 100644 --- a/source4/ntvfs/posix/pvfs_wait.c +++ b/source4/ntvfs/posix/pvfs_wait.c @@ -127,7 +127,7 @@ static int pvfs_wait_destructor(void *ptr) struct timed_event te; struct pvfs_wait *pwait; - pwait = talloc_p(req, struct pvfs_wait); + pwait = talloc_p(pvfs, struct pvfs_wait); if (pwait == NULL) { return NULL; } -- cgit