mirror of https://github.com/MidnightCommander/mc
Ticket #3439: (dir_list_reload): fix memory leak.
When dir_copy filling with fentry objects, dir_list_clean() on dir_copy will never work because dir_copy->len is still zero. Testcase: switch panels on/off. (Found by LeakSanitizer.) Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
67408e5f24
commit
9fa3138377
|
@ -735,6 +735,9 @@ dir_list_reload (dir_list * list, const vfs_path_t * vpath, GCompareFunc sort,
|
|||
}
|
||||
}
|
||||
|
||||
/* save len for later dir_list_clean() */
|
||||
dir_copy.len = list->len;
|
||||
|
||||
/* Add ".." except to the root directory. The ".." entry
|
||||
(if any) must be the first in the list. */
|
||||
tmp_path = vfs_path_get_by_index (vpath, 0)->path;
|
||||
|
|
Loading…
Reference in New Issue