From f9cfb77b8164b77486595356f2ee4d20888c1a6f Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 16 Sep 2023 14:43:18 +0200 Subject: [PATCH] Fix use after free --- workspace.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/workspace.c b/workspace.c index a3ad991..0bbbcf4 100644 --- a/workspace.c +++ b/workspace.c @@ -100,12 +100,7 @@ void workspace_free_tiles(struct cg_workspace *workspace) { workspace->focused_tile->prev->next = NULL; while(workspace->focused_tile != NULL) { - if(workspace->output->server->running && - workspace->output->server->seat->cursor_tile == - workspace->focused_tile) { - workspace->output->server->seat->cursor_tile = NULL; - } - if(workspace->output->server->running && + if(!workspace->output->server->running || workspace->focused_tile == workspace->server->seat->cursor_tile) { workspace->server->seat->cursor_tile = NULL; }