The branch, v4-0-test has been updated via 04eb1be0c67317067ee0ca70c731fef958cd513c (commit) from daab9cb11eb540fae7ec3c024a586f5fd02cfc71 (commit)
http://gitweb.samba.org/?samba.git;a=shortlog;h=v4-0-test - Log ----------------------------------------------------------------- commit 04eb1be0c67317067ee0ca70c731fef958cd513c Author: Stefan Metzmacher <[EMAIL PROTECTED]> Date: Thu Feb 21 19:56:36 2008 +0100 pvfs_open: unify talloc behavior in pvfs_can_delete/rename/stat() And also handle NULL for lckp in the error path without crashing. metze ----------------------------------------------------------------------- Summary of changes: source/ntvfs/posix/pvfs_open.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source/ntvfs/posix/pvfs_open.c b/source/ntvfs/posix/pvfs_open.c index 0d97b3d..3a8b17a 100644 --- a/source/ntvfs/posix/pvfs_open.c +++ b/source/ntvfs/posix/pvfs_open.c @@ -1461,8 +1461,10 @@ NTSTATUS pvfs_can_delete(struct pvfs_state *pvfs, } } else if (!NT_STATUS_IS_OK(status)) { talloc_free(lck); - *lckp = lck; - } else if (lckp != NULL) { + if (lckp) { + *lckp = NULL; + } + } else if (lckp) { *lckp = lck; } @@ -1513,8 +1515,10 @@ NTSTATUS pvfs_can_rename(struct pvfs_state *pvfs, } } else if (!NT_STATUS_IS_OK(status)) { talloc_free(lck); - *lckp = lck; - } else if (lckp != NULL) { + if (lckp) { + *lckp = NULL; + } + } else if (lckp) { *lckp = lck; } @@ -1549,6 +1553,10 @@ NTSTATUS pvfs_can_stat(struct pvfs_state *pvfs, NTCREATEX_SHARE_ACCESS_WRITE, 0, 0); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(lck); + } + return status; } -- Samba Shared Repository