JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix use after free
authorDavid Hill <dhill@conformal.com>
Thu, 12 Jul 2012 18:45:47 +0000 (14:45 -0400)
committerReginald Kennedy <rk@rejii.com>
Fri, 20 Jul 2012 21:58:32 +0000 (05:58 +0800)
spectrwm.c

index f9b2d43..0e76488 100644 (file)
@@ -1015,10 +1015,10 @@ ewmh_get_win_state(struct ws_win *win)
        states = xcb_get_property_value(r);
        n = xcb_get_property_value_length(r);
 
-       free(r);
-
        for (i = 0; i < n; i++)
                ewmh_update_win_state(win, states[i], _NET_WM_STATE_ADD);
+
+       free(r);
 }
 
 /* events */