summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-01-15 17:23:13 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-01-15 17:23:13 +0000
commit43c5c20221bd4c9a8724c4726ab6908666529bd5 (patch)
tree1be1f5e297f8d7a40f0559f60ac786c123555253
parent5967ee7fcf807d88d60a058f0321fa1f339aa5f1 (diff)
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@
-rw-r--r--app/cwm/calmwm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c
index 118829bd7..f0833c074 100644
--- a/app/cwm/calmwm.c
+++ b/app/cwm/calmwm.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: calmwm.c,v 1.31 2008/12/03 23:55:46 oga Exp $
+ * $Id: calmwm.c,v 1.32 2009/01/15 17:23:12 oga Exp $
*/
#include "headers.h"
@@ -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);