1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 14:42:29 +01:00

wmaker: removed unnecessary null pointer check (Coverity #50041)

As pointed by Coverity, the 'cmd' is checked for null at the beginning of
the function, so the second case to handle the null pointer is not needed.
This also means that 'command' cannot be null (wstrdup never returns null)
so the code can also be simplified.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
Christophe CURIS
2014-11-15 19:40:44 +01:00
committed by Carlos R. Mafra
parent 421e9f942c
commit a6d7ac8cb9

View File

@@ -1659,14 +1659,11 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in
return NULL; return NULL;
/* get commands */ /* get commands */
if (cmd) command = wstrdup(WMGetFromPLString(cmd));
command = wstrdup(WMGetFromPLString(cmd));
else if (strcmp(command, "-") == 0) {
command = NULL; wfree(command);
if (!command || strcmp(command, "-") == 0) {
if (command)
wfree(command);
if (wclass) if (wclass)
wfree(wclass); wfree(wclass);
if (winstance) if (winstance)
@@ -1680,8 +1677,8 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in
wfree(wclass); wfree(wclass);
if (winstance) if (winstance)
wfree(winstance); wfree(winstance);
if (command)
wfree(command); wfree(command);
aicon->icon->core->descriptor.handle_mousedown = iconMouseDown; aicon->icon->core->descriptor.handle_mousedown = iconMouseDown;
aicon->icon->core->descriptor.handle_enternotify = clipEnterNotify; aicon->icon->core->descriptor.handle_enternotify = clipEnterNotify;