From f2a7f233e3ce1aefafb216d5d4e768da2776ded1 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Mon, 16 Jun 2014 20:15:20 +0200 Subject: [PATCH] util: remove unnecesary allocation in addWMMenuEntryCallback (Coverity #50161) As pointed by Coverity, the string passed to 'findPositionInMenu' is not freed, and as the function does not modify it it is not necessary to allocate a new storage for the argument. Signed-off-by: Christophe CURIS --- util/wmmenugen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/wmmenugen.c b/util/wmmenugen.c index 47771f56..8dbe4263 100644 --- a/util/wmmenugen.c +++ b/util/wmmenugen.c @@ -175,7 +175,7 @@ static void addWMMenuEntryCallback(WMMenuEntry *aEntry) } if (aEntry->SubMenu) - at = findPositionInMenu(wstrdup(aEntry->SubMenu)); + at = findPositionInMenu(aEntry->SubMenu); if (!at) at = menu;