summary refs log tree commit diff
path: root/calmwm.c
diff options
context:
space:
mode:
authoroga <oga>2009-01-15 17:23:12 +0000
committeroga <oga>2009-01-15 17:23:12 +0000
commit5c757cc7f420f58112d3e2af7a6f124994bcbe23 (patch)
tree290c5549a17a080bf73712dfc3138798f755faac /calmwm.c
parent49e218cf53abe04f6ab07ef29687c9e0ece46a89 (diff)
downloadcwm-5c757cc7f420f58112d3e2af7a6f124994bcbe23.tar.gz
cwm-5c757cc7f420f58112d3e2af7a6f124994bcbe23.tar.xz
cwm-5c757cc7f420f58112d3e2af7a6f124994bcbe23.zip
On startup, don't leak memory when we enumerate existing windows.
The behaviour until now was to ask X for the windows name (which is
malloced) then drop that on the floor and do nothing with it. Skip this
foolery and just skip the window. I don't believe I never noticed this before!

"you can has ok" okan@
Diffstat (limited to 'calmwm.c')
-rw-r--r--calmwm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/calmwm.c b/calmwm.c
index e8cf5d7..7ba6e04 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -229,11 +229,8 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
 	for (i = 0; i < nwins; i++) {
 		XGetWindowAttributes(X_Dpy, wins[i], &winattr);
 		if (winattr.override_redirect ||
-		    winattr.map_state != IsViewable) {
-			char *name;
-			XFetchName(X_Dpy, wins[i], &name);
+		    winattr.map_state != IsViewable)
 			continue;
-		}
 		client_new(wins[i], sc, winattr.map_state != IsUnmapped);
 	}
 	XFree(wins);