fix for bug #3439 was not complete, further dir_copy list handling
1. handling dir_copy list as full copy for avoid double free situations
2. dir_list_init must always have a dir_list_clean() before
found by LeakSanitizer
Signed-off-by: Andreas Mohr <and@gmx.li>
a
|
b
|
|
721 | 721 | dfentry = &dir_copy.list[i]; |
722 | 722 | |
723 | 723 | dfentry->fnamelen = fentry->fnamelen; |
724 | | dfentry->fname = fentry->fname; |
| 724 | dfentry->fname = g_strndup (fentry->fname, fentry->fnamelen); |
725 | 725 | dfentry->f.marked = fentry->f.marked; |
726 | 726 | dfentry->f.dir_size_computed = fentry->f.dir_size_computed; |
727 | 727 | dfentry->f.link_to_dir = fentry->f.link_to_dir; |
… |
… |
|
748 | 748 | } |
749 | 749 | else |
750 | 750 | { |
| 751 | dir_list_clean (list); |
751 | 752 | if (!dir_list_init (list)) |
752 | 753 | { |
753 | 754 | dir_list_clean (&dir_copy); |