From 7013b72dce15fceef065e506b2cf03ab28b34e21 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 15 Nov 2014 19:40:49 +0100 Subject: [PATCH] wmaker: remove unnecessary null check in readMenuDirectory (Coverity #50190) As pointed by Coverity, the pointer cannot be null, otherwise the code would have crashed earlier. As the code seems to always set a valid pointer, there's no need to make a check there. Signed-off-by: Christophe CURIS Signed-off-by: Carlos R. Mafra --- src/rootmenu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rootmenu.c b/src/rootmenu.c index 13032044..fca0cb72 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -1359,8 +1359,7 @@ static WMenu *readMenuDirectory(WScreen *scr, const char *title, char **path, co addMenuEntry(menu, M_(data->name), NULL, "OPEN_MENU", buffer, path[data->index]); wfree(buffer); - if (data->name) - wfree(data->name); + wfree(data->name); wfree(data); } @@ -1405,8 +1404,7 @@ static WMenu *readMenuDirectory(WScreen *scr, const char *title, char **path, co addMenuEntry(menu, M_(data->name), NULL, "SHEXEC", buffer, path[data->index]); wfree(buffer); - if (data->name) - wfree(data->name); + wfree(data->name); wfree(data); }