(panel_recursive_cd_to_parent): fix memory leak.

Found by Coverity.
Coverity id #331846.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-05-28 09:57:25 +03:00
parent b6a169cc24
commit 69b8927ec9

View File

@ -4180,7 +4180,10 @@ panel_recursive_cd_to_parent (const vfs_path_t * vpath)
/* check if path contains only '/' */
panel_cwd_path = vfs_path_as_str (cwd_vpath);
if (panel_cwd_path != NULL && IS_PATH_SEP (panel_cwd_path[0]) && panel_cwd_path[1] == '\0')
{
vfs_path_free (cwd_vpath, TRUE);
return NULL;
}
tmp_vpath = vfs_path_vtokens_get (cwd_vpath, 0, -1);
vfs_path_free (cwd_vpath, TRUE);