smbd: Make fsp_attach_smb_fname() talloc_move() the name to the fsp
authorVolker Lendecke <vl@samba.org>
Tue, 14 Jun 2022 14:52:39 +0000 (16:52 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 25 Jul 2022 12:04:33 +0000 (12:04 +0000)
For the current callers this does not make a difference, they have
already allocated *_smb_fname as a talloc child of fsp, but the next
patches will add one where it does.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/files.c

index 3d8031bf21f0a25ce90bcc3486ed8590f2fceb3b..c96605555691b92d3b3c5b211831edaab2489031 100644 (file)
@@ -1596,7 +1596,7 @@ NTSTATUS file_name_hash(connection_struct *conn,
 static NTSTATUS fsp_attach_smb_fname(struct files_struct *fsp,
                                     struct smb_filename **_smb_fname)
 {
-       struct smb_filename *smb_fname_new = *_smb_fname;
+       struct smb_filename *smb_fname_new = talloc_move(fsp, _smb_fname);
        const char *name_str = NULL;
        uint32_t name_hash = 0;
        NTSTATUS status;