diff --git a/src/backends/x11/meta-input-device-x11.c b/src/backends/x11/meta-input-device-x11.c index 999237a54..d40dd8337 100644 --- a/src/backends/x11/meta-input-device-x11.c +++ b/src/backends/x11/meta-input-device-x11.c @@ -401,7 +401,7 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2) { Window xroot_window, xchild_window; double xroot_x, xroot_y, xwin_x, xwin_y; - XIButtonState button_state; + XIButtonState button_state = { 0 }; XIModifierState mod_state; XIGroupState group_state; int result; @@ -419,6 +419,8 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2) &group_state); clutter_x11_untrap_x_errors (); + g_free (button_state.mask); + if (!result) return FALSE; diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c index 6ae6f5f3b..5b899114d 100644 --- a/src/backends/x11/meta-seat-x11.c +++ b/src/backends/x11/meta-seat-x11.c @@ -1559,7 +1559,7 @@ meta_seat_x11_query_state (ClutterSeat *seat, MetaSeatX11 *seat_x11 = META_SEAT_X11 (seat); Window root_ret, child_ret; double root_x, root_y, win_x, win_y; - XIButtonState button_state; + XIButtonState button_state = { 0 }; XIModifierState modifier_state; XIGroupState group_state; @@ -1571,7 +1571,10 @@ meta_seat_x11_query_state (ClutterSeat *seat, &root_x, &root_y, &win_x, &win_y, &button_state, &modifier_state, &group_state); if (clutter_x11_untrap_x_errors ()) - return FALSE; + { + g_free (button_state.mask); + return FALSE; + } if (sequence) { @@ -1579,7 +1582,10 @@ meta_seat_x11_query_state (ClutterSeat *seat, touch_info = g_hash_table_lookup (seat_x11->touch_coords, sequence); if (!touch_info) - return FALSE; + { + g_free (button_state.mask); + return FALSE; + } if (coords) { @@ -1599,6 +1605,7 @@ meta_seat_x11_query_state (ClutterSeat *seat, if (modifiers) *modifiers = translate_state (&button_state, &modifier_state, &group_state); + g_free (button_state.mask); return TRUE; }