From: Christophe CURIS <christophe.cu...@free.fr> As pointed by Coverity, there is in the same procedure a check for null pointer before use, and later a direct use without check.
In most case, the pointer is not null, but it one case it is hard to be sure that the pointer cannot be null, so it's safer to just add a check there also. Took opportunity to swap the order of the arguments in the if, because if the config flag is false it is not necessary to spend time on doing the more expensive strcmp. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> --- src/appicon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appicon.c b/src/appicon.c index 1d28a24..ed03ffc 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -126,7 +126,7 @@ WAppIcon *wAppIconCreateForDock(WScreen *scr, const char *command, const char *w if (wm_instance) aicon->wm_instance = wstrdup(wm_instance); - if (strcmp(wm_class, "WMDock") == 0 && wPreferences.flags.clip_merged_in_dock) + if (wPreferences.flags.clip_merged_in_dock && wm_class != NULL && strcmp(wm_class, "WMDock") == 0) tile = TILE_CLIP; aicon->icon = icon_create_for_dock(scr, command, wm_instance, wm_class, tile); -- 2.1.1 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.