aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak <dos@dosowisko.net>2019-08-07 15:25:26 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-09 08:05:55 +0900
commit913cac18359d7962e74892771bf6bd3ecf54a4a1 (patch)
tree202040a52bc3fcc761bba18ffe9cdb9e1738ea63
parent01f903874b7e27539488fad7f31476d5bcbc6ac9 (diff)
wlr_input_method_v2: Remove input method's resource from the list on destroy
It's added to manager->input_methods list in manager_get_input_method, but wasn't removed anywhere, leading to possible use-after-free in wlr_input_method_manager_v2_destroy.
-rw-r--r--types/wlr_input_method_v2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/types/wlr_input_method_v2.c b/types/wlr_input_method_v2.c
index c68ff88b..6dcc70bc 100644
--- a/types/wlr_input_method_v2.c
+++ b/types/wlr_input_method_v2.c
@@ -22,6 +22,7 @@ static struct wlr_input_method_v2 *input_method_from_resource(
static void input_method_destroy(struct wlr_input_method_v2 *input_method) {
wlr_signal_emit_safe(&input_method->events.destroy, input_method);
+ wl_list_remove(wl_resource_get_link(input_method->resource));
wl_list_remove(&input_method->seat_destroy.link);
free(input_method->pending.commit_text);
free(input_method->pending.preedit.text);