From 4a11609b7634356978e48b8b6976922777cf9e61 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 25 Dec 2017 18:18:26 +0100 Subject: Fix use-after-free when destroying selection sources --- xwayland/selection.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xwayland') diff --git a/xwayland/selection.c b/xwayland/selection.c index be803599..e59bc4e6 100644 --- a/xwayland/selection.c +++ b/xwayland/selection.c @@ -508,6 +508,7 @@ static void data_source_send(struct wlr_data_source *base, static void data_source_cancel(struct wlr_data_source *base) { struct x11_data_source *source = (struct x11_data_source *)base; + wlr_data_source_finish(&source->base); wl_array_release(&source->mime_types_atoms); free(source); } @@ -533,6 +534,7 @@ static void primary_selection_source_cancel( struct wlr_primary_selection_source *base) { struct x11_primary_selection_source *source = (struct x11_primary_selection_source *)base; + wlr_primary_selection_source_finish(&source->base); wl_array_release(&source->mime_types_atoms); free(source); } -- cgit v1.2.3