JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
check replies separately
authorDavid Hill <dhill@conformal.com>
Fri, 20 Jul 2012 16:57:50 +0000 (12:57 -0400)
committerReginald Kennedy <rk@rejii.com>
Fri, 20 Jul 2012 22:00:03 +0000 (06:00 +0800)
spectrwm.c

index 1751412..5f25088 100644 (file)
@@ -820,7 +820,9 @@ teardown_ewmh(void)
                pc = xcb_get_property(conn, 0, screens[i].root, sup_check,
                    XCB_ATOM_WINDOW, 0, 1);
                pr = xcb_get_property_reply(conn, pc, NULL);
-               if (pr && pr->format == sup_check) {
+               if (!pr)
+                       continue;
+               if (pr->format == sup_check) {
                        id = *((xcb_window_t *)xcb_get_property_value(pr));
 
                        xcb_destroy_window(conn, id);
@@ -6422,7 +6424,9 @@ get_ws_idx(xcb_window_t id)
                xcb_get_property(conn, 0, id, a_swm_ws,
                    XCB_ATOM_STRING, 0, SWM_PROPLEN),
                NULL);
-       if (gpr && gpr->type) {
+       if (!gpr)
+               return (-1);
+       if (gpr->type) {
                proplen = xcb_get_property_value_length(gpr);
                if (proplen > 0) {
                        prop = malloc(proplen + 1);