From 52b23d8fb55df76eaee5f5d4237046a6241d2ab9 Mon Sep 17 00:00:00 2001 From: Anskrevy <95379591+Anskrevy@users.noreply.github.com> Date: Fri, 16 Feb 2024 21:06:20 -0800 Subject: [PATCH] Fix use after free in `wayland.c` --- lib/renderers/wayland/wayland.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/renderers/wayland/wayland.c b/lib/renderers/wayland/wayland.c index 88f6ff4..2da88b9 100644 --- a/lib/renderers/wayland/wayland.c +++ b/lib/renderers/wayland/wayland.c @@ -547,8 +547,10 @@ recreate_windows(const struct bm_menu *menu, struct wayland *wayland) wl_output = output->output; if (!bm_wl_window_create(window, wayland->display, wayland->shm, - wl_output, wayland->layer_shell, surface)) + wl_output, wayland->layer_shell, surface)) { free(window); + goto fail; + } window->notify.render = bm_cairo_paint; window->render_pending = true;