From: Ralph Boehme Date: Mon, 4 Jan 2021 15:09:43 +0000 (+0100) Subject: s3:smbd: turn assignment into assert check in call_trans2findfirst() X-Git-Tag: samba-4.14.0rc1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eae7ce8a2e0e0982bba70fbd36f444954339abe3;p=thirdparty%2Fsamba.git s3:smbd: turn assignment into assert check in call_trans2findfirst() The pathref fsp link destructor will set smb_dname->fsp to NULL. Turning this into an assert to give a hint at readers of the code trying to understand the mechanics. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index cdaf68c579a..711c2aead47 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2833,8 +2833,13 @@ close_if_end = %d requires_resume_key = %d backup_priv = %d level = 0x%x, max_da * correct path. */ if (smb_dname->fsp != NULL) { + /* + * The pathref fsp link destructor will set smb_dname->fsp to + * NULL. Turning this into an assert to give a hint at readers + * of the code trying to understand the mechanics. + */ file_free(req, smb_dname->fsp); - smb_dname->fsp = NULL; + SMB_ASSERT(smb_dname->fsp == NULL); } mask = get_original_lcomp(talloc_tos(),