From 61e61a72691cca027248a3cb426b4b1bde4cbae0 Mon Sep 17 00:00:00 2001 From: Brendan Powers Date: Wed, 16 Dec 2009 18:48:23 -0500 Subject: [PATCH] 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. --- source4/ntvfs/posix/pvfs_open.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 621db3c..aa66ad7 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) { -- 1.5.4.3