From a74c7a915f261fe2b111a8e2035ac1b028d963cf Mon Sep 17 00:00:00 2001
From: David Maciejak <david.maciejak@gmail.com>
Date: Sun, 27 Jul 2014 14:23:49 +0800
Subject: [PATCH 3/4] wmaker: superfluous.c possible null pointer dereference

As reported by cppcheck:
[src/superfluous.c:238] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.
[src/superfluous.c:239] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.
[src/superfluous.c:240] -> [src/superfluous.c:199]: (warning) Possible null pointer dereference: aicon - otherwise it is redundant to check it against null.

The patch is adding a test to check if variable aicon exists.
---
 src/superfluous.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/superfluous.c b/src/superfluous.c
index 0883cc1..4e30542 100644
--- a/src/superfluous.c
+++ b/src/superfluous.c
@@ -195,8 +195,11 @@ static void doAppBounce(void *arg)
 	AppBouncerData *data = (AppBouncerData*)arg;
 	WAppIcon *aicon = data->wapp->app_icon;
 
+	if (!aicon)
+		return;
+
 reinit:
-	if (aicon && data->wapp->refcount > 1) {
+	if (data->wapp->refcount > 1) {
 		if (wPreferences.raise_appicons_when_bouncing)
 			XRaiseWindow(dpy, aicon->icon->core->window);
 
-- 
1.8.3.2

