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:
Andreas Mohr 2015-04-11 13:03:19 +03:00 committed by Andrew Borodin
parent 67408e5f24
commit 9fa3138377
1 changed files with 3 additions and 0 deletions

View File

@ -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;