aboutsummaryrefslogtreecommitdiff
path: root/xwayland/selection.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-25 18:18:26 +0100
committeremersion <contact@emersion.fr>2017-12-25 18:18:26 +0100
commit4a11609b7634356978e48b8b6976922777cf9e61 (patch)
tree2ff49ed4006e6972ead3e646a1d7e1777d07920b /xwayland/selection.c
parentcdc21cdcff7e8d9beb1f8d0ea00b71b141c17466 (diff)
Fix use-after-free when destroying selection sources
Diffstat (limited to 'xwayland/selection.c')
-rw-r--r--xwayland/selection.c2
1 files changed, 2 insertions, 0 deletions
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);
}