summary refs log tree commit diff
path: root/screen.c
diff options
context:
space:
mode:
authorokan <okan>2014-02-02 16:13:50 +0000
committerokan <okan>2014-02-02 16:13:50 +0000
commit5f9c7a21c71d8386ae7eb7b03bdfb9c58dbe1b19 (patch)
treef13c00f4dae0bb654a073fb859005cc21a798512 /screen.c
parent0a71742af4f4b54cc1b2ea5efd5acfa2eb4113ba (diff)
downloadcwm-5f9c7a21c71d8386ae7eb7b03bdfb9c58dbe1b19.tar.gz
cwm-5f9c7a21c71d8386ae7eb7b03bdfb9c58dbe1b19.tar.xz
cwm-5f9c7a21c71d8386ae7eb7b03bdfb9c58dbe1b19.zip
Unlike free(3), XFree(3) can't be passed a NULL pointer.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/screen.c b/screen.c
index 257afe3..fa90f96 100644
--- a/screen.c
+++ b/screen.c
@@ -65,7 +65,6 @@ screen_init(int which)
 
 	/* Deal with existing clients. */
 	XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins);
-
 	for (i = 0; i < nwins; i++) {
 		XGetWindowAttributes(X_Dpy, wins[i], &winattr);
 		if (winattr.override_redirect ||
@@ -73,7 +72,8 @@ screen_init(int which)
 			continue;
 		(void)client_init(wins[i], sc, winattr.map_state != IsUnmapped);
 	}
-	XFree(wins);
+	if (wins)
+		XFree(wins);
 
 	screen_updatestackingorder(sc);