mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +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:
committed by
Carlos R. Mafra
parent
e828e1c074
commit
4559cbbccc
@@ -1502,8 +1502,12 @@ static void showData(_Panel * panel)
|
|||||||
|
|
||||||
path = wexpandpath(WMGetFromPLString(pmenu));
|
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);
|
path = wfindfile(DEF_CONFIG_PATHS, path);
|
||||||
|
wfree(old_path);
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: if needed, concatenate locale suffix to path.
|
/* TODO: if needed, concatenate locale suffix to path.
|
||||||
See getLocalizedMenuFile() in src/rootmenu.c. */
|
See getLocalizedMenuFile() in src/rootmenu.c. */
|
||||||
|
|||||||
Reference in New Issue
Block a user