extract.c: file_name_valid(): fix bad memdup
authorEric Biggers <ebiggers3@gmail.com>
Tue, 24 Mar 2015 00:31:15 +0000 (19:31 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 26 Mar 2015 00:56:37 +0000 (19:56 -0500)
src/extract.c

index 5b1c1cc609de5edf5fbc565d6ed808a1a791603e..68fab3fd2e95f3e30be19bf6e2dbf5514ae600bf 100644 (file)
@@ -877,8 +877,7 @@ out_replace:
 
                utf16le_put_tstr(tchar_name);
 
 
                utf16le_put_tstr(tchar_name);
 
-               dentry->d_extraction_name = memdup(fixed_name,
-                                                  2 * fixed_name_num_chars + 2);
+               dentry->d_extraction_name = TSTRDUP(fixed_name);
                if (!dentry->d_extraction_name)
                        return WIMLIB_ERR_NOMEM;
                dentry->d_extraction_name_nchars = fixed_name_num_chars;
                if (!dentry->d_extraction_name)
                        return WIMLIB_ERR_NOMEM;
                dentry->d_extraction_name_nchars = fixed_name_num_chars;