From 89cbe7ed5f863c206f9c877fa484dbdb45040aad Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Sat, 30 Jun 2012 19:44:21 +0300 Subject: rework propertynotify function - add parenthesis and check XWMHints pointer before free --- monsterwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monsterwm.c b/monsterwm.c index 9d4391d..a913392 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -687,8 +687,8 @@ void propertynotify(XEvent *e) { Client *c = wintoclient(e->xproperty.window); if (!c || e->xproperty.atom != XA_WM_HINTS) return; XWMHints *wmh = XGetWMHints(dis, c->win); - c->isurgent = c != curr && wmh && (wmh->flags & XUrgencyHint); - XFree(wmh); + c->isurgent = (c != curr && wmh && (wmh->flags & XUrgencyHint)); + if (wmh) XFree(wmh); desktopinfo(); } -- cgit v1.3.1