X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fntfs-3g_capture.c;h=034bd1b0e3d897bbfc887dfb79fdff1a3a97900b;hp=9f03b6383b0aa057ec9dac664b3eed2fe960a10a;hb=2e44f90c21db693058037f83f92ad136c818ce9d;hpb=1c940d499beb539f846ed2509e3fee7772adf250;ds=sidebyside diff --git a/src/ntfs-3g_capture.c b/src/ntfs-3g_capture.c index 9f03b638..034bd1b0 100644 --- a/src/ntfs-3g_capture.c +++ b/src/ntfs-3g_capture.c @@ -220,21 +220,18 @@ capture_ntfs_streams(struct wim_inode *inode, goto out_put_actx; } ntfs_loc->ntfs_vol = vol; - ntfs_loc->path = MALLOC(path_len + 1); + ntfs_loc->path = memdup(path, path_len + 1); if (!ntfs_loc->path) { ret = WIMLIB_ERR_NOMEM; goto out_free_ntfs_loc; } - memcpy(ntfs_loc->path, path, path_len + 1); if (name_length) { - ntfs_loc->stream_name = MALLOC(name_length * 2); + ntfs_loc->stream_name = memdup(attr_record_name(actx->attr), + name_length * 2); if (!ntfs_loc->stream_name) { ret = WIMLIB_ERR_NOMEM; goto out_free_ntfs_loc; } - memcpy(ntfs_loc->stream_name, - attr_record_name(actx->attr), - actx->attr->name_length * 2); ntfs_loc->stream_name_nchars = name_length; }