Don't talloc_strdup() the stream_name, just to free it again.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
struct smb_filename *cp_smb_filename_nostream(TALLOC_CTX *mem_ctx,
const struct smb_filename *smb_fname_in)
{
- struct smb_filename *smb_fname = cp_smb_filename(mem_ctx,
- smb_fname_in);
- if (smb_fname == NULL) {
- return NULL;
- }
- TALLOC_FREE(smb_fname->stream_name);
+ struct smb_filename smb_fname_loc = *smb_fname_in;
+ struct smb_filename *smb_fname = NULL;
+
+ smb_fname_loc.stream_name = NULL;
+
+ smb_fname = cp_smb_filename(mem_ctx, &smb_fname_loc);
return smb_fname;
}