mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-24 06:59:45 -05:00
Fix use-after-free when destroying selection sources
This commit is contained in:
parent
cdc21cdcff
commit
4a11609b76
5 changed files with 37 additions and 19 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue