[PATCH] desktop-shell: fix bug referencing invalid surface list

Ryo Munakata ryomnktml at gmail.com
Wed Jul 29 11:12:38 PDT 2015


In shell_destroy_shell_surface, we remove the link of a shell_surface.
There is a case which the link references shell_client::surface_list
which is already free'd.
Therefore we have to remove shell_client::surface_list when freeing
a shell_client.

Signed-off-by: Ryo Munakata <ryomnktml at gmail.com>
---
 desktop-shell/shell.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 9e3701f..9caf5bc 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -5791,6 +5791,9 @@ handle_shell_client_destroy(struct wl_listener *listener, void *data)
 
 	if (sc->ping_timer)
 		wl_event_source_remove(sc->ping_timer);
+
+	wl_list_remove(&sc->surface_list);
+
 	free(sc);
 }
 
-- 
2.5.0



More information about the wayland-devel mailing list