- if (smb_fname_in->original_lcomp) {
- (*smb_fname_out)->original_lcomp =
- talloc_strdup(*smb_fname_out, smb_fname_in->original_lcomp);
- if (!(*smb_fname_out)->original_lcomp)
- goto no_mem_err;
+ out = talloc_zero(mem_ctx, struct smb_filename);
+ if (out == NULL) {
+ return NULL;
+ }
+ if (in->base_name != NULL) {
+ out->base_name = talloc_strdup(out, in->base_name);
+ if (out->base_name == NULL) {
+ goto fail;
+ }
+ }
+ if (in->stream_name != NULL) {
+ out->stream_name = talloc_strdup(out, in->stream_name);
+ if (out->stream_name == NULL) {
+ goto fail;
+ }
+ }
+ if (in->original_lcomp != NULL) {
+ out->original_lcomp = talloc_strdup(out, in->original_lcomp);
+ if (out->original_lcomp == NULL) {
+ goto fail;
+ }