1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

WPrefs: Fix memory leak in the Menu tab

As reported by Coverity (CID #331559), the call to 'wfindfile' replaces
the value for variable 'path' but we did not free its previous content.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2021-05-14 20:17:04 +02:00
committed by Carlos R. Mafra
parent e828e1c074
commit 4559cbbccc

View File

@@ -1502,8 +1502,12 @@ static void showData(_Panel * panel)
path = wexpandpath(WMGetFromPLString(pmenu));
if (access(path, F_OK) < 0)
if (access(path, F_OK) < 0) {
char *old_path = path;
path = wfindfile(DEF_CONFIG_PATHS, path);
wfree(old_path);
}
/* TODO: if needed, concatenate locale suffix to path.
See getLocalizedMenuFile() in src/rootmenu.c. */