From 39ac9d5d1d81b67000dc7a8bac5ea155013485ca Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Fri, 3 Feb 2012 08:01:09 -0600 Subject: [PATCH] be more paranoid when freeing memory and some whitespace fixes --- scrotwm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scrotwm.c b/scrotwm.c index 10b638c..edf326d 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -995,7 +995,7 @@ geteventname(XEvent *e) char * xrandr_geteventname(XEvent *e) { - char *name = NULL; + char *name = NULL; switch(e->type - xrandr_eventbase) { case RRScreenChangeNotify: @@ -2485,7 +2485,6 @@ done: if (window_name_enabled || title_name_enabled || title_class_enabled) bar_update(); - return; } @@ -5082,7 +5081,7 @@ setquirk(const char *class, const char *name, unsigned long quirk) struct quirk *qp; DNPRINTF(SWM_D_QUIRK, "setquirk: enter %s:%s [%lu]\n", class, name, - quirk); + quirk); TAILQ_FOREACH(qp, &quirks, entry) { if (!strcmp(qp->class, class) && !strcmp(qp->name, name)) { @@ -5955,7 +5954,10 @@ unmanage_window(struct ws_win *win) focus_prev(win); - XFree(win->hints); + if (win->hints) { + XFree(win->hints); + win->hints = NULL; + } TAILQ_REMOVE(&win->ws->winlist, win, entry); TAILQ_INSERT_TAIL(&win->ws->unmanagedlist, win, entry); -- 1.7.10.4