Fix segfault during cleanup when wlr_scene isn't created

If backend creation fails, server.scene is NULL.

Discovered when investigating the following issue:
https://github.com/cage-kiosk/cage/issues/481
This commit is contained in:
Simon Ser 2026-03-05 15:28:21 +01:00
parent dcd64ae48b
commit 0ee1db3ed0

4
cage.c
View file

@ -667,7 +667,9 @@ end:
/* This function is not null-safe, but we only ever get here
with a proper wl_display. */
wl_display_destroy(server.wl_display);
wlr_scene_node_destroy(&server.scene->tree.node);
if (server.scene != NULL) {
wlr_scene_node_destroy(&server.scene->tree.node);
}
wlr_allocator_destroy(server.allocator);
wlr_renderer_destroy(server.renderer);
return ret;