From 0708b2a0c91aa3d0c836a3edf21b3cb8fbdcd76c Mon Sep 17 00:00:00 2001 From: brendan powers Date: Wed, 16 Dec 2009 19:01:32 -0500 Subject: s4-ntvfs: check if pvfs is NULL in pvfs_logoff pvfs can be NULL if the directory a share points to does not exist. In this case, there would be no open files, so it is safe to just return from the function. Signed-off-by: Andrew Tridgell --- source4/ntvfs/posix/pvfs_open.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/ntvfs/posix') diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 621db3cf1d..aa66ad782d 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -1713,6 +1713,11 @@ NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs, struct pvfs_state); struct pvfs_file *f, *next; + /* If pvfs is NULL, we never logged on, and no files are open. */ + if(pvfs == NULL) { + return NT_STATUS_OK; + } + for (f=pvfs->files.list;f;f=next) { next = f->next; if (f->ntvfs->session_info == req->session_info) { -- cgit