1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

smbd: update smb_Dir_destructor() to cope with fsp->dptr not being set

Currently the only caller of OpenDir_fsp() is dptr_create() which means
fsp->dptr will always be set by dptr_create().

A subsequent commit will add another caller so that fsp->dptr will end up being
NULL.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2020-03-18 18:25:33 +01:00 committed by Jeremy Allison
parent 6dccfd63a8
commit b6bcc4bddc

View File

@ -1317,8 +1317,10 @@ static int smb_Dir_destructor(struct smb_Dir *dir_hnd)
SMB_VFS_CLOSEDIR(dir_hnd->conn, dir_hnd->dir); SMB_VFS_CLOSEDIR(dir_hnd->conn, dir_hnd->dir);
fsp->fh->fd = -1; fsp->fh->fd = -1;
SMB_ASSERT(fsp->dptr->dir_hnd == dir_hnd); if (fsp->dptr != NULL) {
fsp->dptr->dir_hnd = NULL; SMB_ASSERT(fsp->dptr->dir_hnd == dir_hnd);
fsp->dptr->dir_hnd = NULL;
}
dir_hnd->fsp = NULL; dir_hnd->fsp = NULL;
return 0; return 0;
} }