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:
committed by
Carlos R. Mafra
parent
421e9f942c
commit
a6d7ac8cb9
@@ -1659,14 +1659,11 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in
|
||||
return NULL;
|
||||
|
||||
/* get commands */
|
||||
if (cmd)
|
||||
command = wstrdup(WMGetFromPLString(cmd));
|
||||
else
|
||||
command = NULL;
|
||||
|
||||
if (!command || strcmp(command, "-") == 0) {
|
||||
if (command)
|
||||
if (strcmp(command, "-") == 0) {
|
||||
wfree(command);
|
||||
|
||||
if (wclass)
|
||||
wfree(wclass);
|
||||
if (winstance)
|
||||
@@ -1680,7 +1677,7 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in
|
||||
wfree(wclass);
|
||||
if (winstance)
|
||||
wfree(winstance);
|
||||
if (command)
|
||||
|
||||
wfree(command);
|
||||
|
||||
aicon->icon->core->descriptor.handle_mousedown = iconMouseDown;
|
||||
|
||||
Reference in New Issue
Block a user