From 9fa161ed095783a17e62063ee0772c757400aee4 Mon Sep 17 00:00:00 2001 From: "Tran Ba Khang(MS/EMC31-XC)" Date: Thu, 10 Nov 2022 16:18:29 +0700 Subject: [PATCH] hmi-controller: add missing removals of surface listeners The surface listeners must remove when hmi-controller destroying. To avoid to use after free. Suggested-by: Marius Vlad Signed-off-by: Tran Ba Khang(MS/EMC31-XC) --- ivi-shell/hmi-controller.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 6c0df68a0..2470187ca 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -758,6 +758,10 @@ hmi_controller_destroy(struct wl_listener *listener, void *data) free(ctrl_layer_link); } + wl_list_remove(&hmi_ctrl->surface_removed.link); + wl_list_remove(&hmi_ctrl->surface_configured.link); + wl_list_remove(&hmi_ctrl->desktop_surface_configured.link); + wl_array_release(&hmi_ctrl->ui_widgets); free(hmi_ctrl->hmi_setting); free(hmi_ctrl);