From 2a8fc1df9a7472ee9aa0bc9d00a76d953ac3181e Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 16 May 2021 15:47:12 +0200 Subject: [PATCH] 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 --- util/wmmenugen_parse_xdg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/wmmenugen_parse_xdg.c b/util/wmmenugen_parse_xdg.c index 83800ba1..27690f1f 100644 --- a/util/wmmenugen_parse_xdg.c +++ b/util/wmmenugen_parse_xdg.c @@ -448,11 +448,11 @@ static void getLocalizedStringValue(char **target, const char *line, int *match_ } if (compare_matchlevel(match_level, locale)) { - wfree(locale); *target = wstrdup(p + kstart); - return; } + wfree(locale); + return; }