mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
wmmenugen: Fix memory leak when parsing names for menus in XDG format
As reported by Coverity (CID #50146), if the function getLocalizedStringValue returns without matching the entry, the storage for the entry's locale was leaked. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
296456f361
commit
2a8fc1df9a
@@ -448,11 +448,11 @@ static void getLocalizedStringValue(char **target, const char *line, int *match_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (compare_matchlevel(match_level, locale)) {
|
if (compare_matchlevel(match_level, locale)) {
|
||||||
wfree(locale);
|
|
||||||
*target = wstrdup(p + kstart);
|
*target = wstrdup(p + kstart);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wfree(locale);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user