From: Ralph Boehme Date: Sun, 4 Aug 2019 07:15:47 +0000 (+0200) Subject: s3: smbd: simplify dptr_CloseDir() X-Git-Tag: tdb-1.4.2~333 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7d72cf02e799502bf7df93183d325a3d50433569;p=thirdparty%2Fsamba.git s3: smbd: simplify dptr_CloseDir() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 61c91029364..5214ccc2dbf 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -370,15 +370,17 @@ done: void dptr_CloseDir(files_struct *fsp) { - if (fsp->dptr) { - /* - * The destructor for the struct smb_Dir - * (fsp->dptr->dir_hnd) now handles - * all resource deallocation. - */ - dptr_close_internal(fsp->dptr); - fsp->dptr = NULL; + if (fsp->dptr == NULL) { + return; } + + /* + * The destructor for the struct smb_Dir (fsp->dptr->dir_hnd) + * now handles all resource deallocation. + */ + + dptr_close_internal(fsp->dptr); + fsp->dptr = NULL; } void dptr_SeekDir(struct dptr_struct *dptr, long offset)