]> git.lizzy.rs Git - bspwm.git/commitdiff
Don't wipe unallocated structures
authorBastien Dejean <nihilhill@gmail.com>
Tue, 17 Sep 2013 15:50:50 +0000 (17:50 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 17 Sep 2013 15:50:50 +0000 (17:50 +0200)
rules.c

diff --git a/rules.c b/rules.c
index 3a034c71741635d04e3e4ec62f94874223ebc4e0..f1272ad0baeec10e818f62299d0b5c5f454fa584 100644 (file)
--- a/rules.c
+++ b/rules.c
@@ -53,11 +53,13 @@ rule_t *find_rule(unsigned int uid)
 bool is_match(rule_t *r, xcb_window_t win)
 {
     xcb_icccm_get_wm_class_reply_t reply;
+    int8_t success = 0;
     if (streq(r->cause.name, MATCH_ALL) ||
-            (xcb_icccm_get_wm_class_reply(dpy, xcb_icccm_get_wm_class(dpy, win), &reply, NULL) == 1
+            ((success = xcb_icccm_get_wm_class_reply(dpy, xcb_icccm_get_wm_class(dpy, win), &reply, NULL)) == 1
             && (streq(reply.class_name, r->cause.name)
                 || streq(reply.instance_name, r->cause.name)))) {
-        xcb_icccm_get_wm_class_reply_wipe(&reply);
+        if (success)
+            xcb_icccm_get_wm_class_reply_wipe(&reply);
         return true;
     }
     return false;