aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-01-29 22:40:10 +0100
committeremersion <contact@emersion.fr>2019-01-30 15:24:14 +0100
commitc505ce30191441f6bdc47eae13cf1af83d2fab41 (patch)
treeab6c7cadcd37d21c9262f264ed4f8da6e15fac5b
parenta37dfb380b4d519f943e23ee69671aa64b098ecf (diff)
data-device: fix use-after-free on drop
-rw-r--r--types/data_device/wlr_drag.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/types/data_device/wlr_drag.c b/types/data_device/wlr_drag.c
index d6e93cb2..20c9b30e 100644
--- a/types/data_device/wlr_drag.c
+++ b/types/data_device/wlr_drag.c
@@ -174,7 +174,9 @@ static uint32_t drag_handle_pointer_button(struct wlr_seat_pointer_grab *grab,
};
wlr_signal_emit_safe(&drag->events.drop, &event);
} else if (drag->source->impl->dnd_finish) {
+ // This will end the grab and free `drag`
wlr_data_source_destroy(drag->source);
+ return 0;
}
}