xwayland: zalloc the x11_data_sources

The wrapped weston_data_source struct has new fields which were left
uninitialized, so its access is unreliable.

The data source in xwayland/dnd.c should be eventually setting the
drag-and-drop actions, but it is a lot more incomplete than that
(read: completely), so falls out of the scope of this patch.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
dev
Carlos Garnacho 9 years ago committed by Bryce Harrington
parent 15902bf47a
commit beb7a9f92d
  1. 2
      xwayland/dnd.c
  2. 2
      xwayland/selection.c

@ -162,7 +162,7 @@ handle_enter(struct weston_wm *wm, xcb_client_message_event_t *client_message)
xcb_get_property_cookie_t cookie; xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply; xcb_get_property_reply_t *reply;
source = malloc(sizeof *source); source = zalloc(sizeof *source);
if (source == NULL) if (source == NULL)
return; return;

@ -197,7 +197,7 @@ weston_wm_get_selection_targets(struct weston_wm *wm)
return; return;
} }
source = malloc(sizeof *source); source = zalloc(sizeof *source);
if (source == NULL) { if (source == NULL) {
free(reply); free(reply);
return; return;

Loading…
Cancel
Save