From 7d2b5150e81a2b85a949942d1f49eee356533ac5 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Fri, 4 Jul 2025 00:45:59 -0400 Subject: [PATCH] session-lock: eliminate pointless compound literal In C++, this would have caused a use-after-free. In C, the unnamed array remains in scope longer, so it's okay, but still pointless. --- src/session-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session-lock.c b/src/session-lock.c index edad8f64..0a140ca6 100644 --- a/src/session-lock.c +++ b/src/session-lock.c @@ -216,7 +216,7 @@ session_lock_output_create(struct session_lock_manager *manager, struct output * * all outputs with an opaque color such that their normal content is * fully hidden */ - float *black = (float[4]) { 0.f, 0.f, 0.f, 1.f }; + float black[4] = { 0.f, 0.f, 0.f, 1.f }; struct wlr_scene_rect *background = wlr_scene_rect_create(tree, 0, 0, black); if (!background) { wlr_log(WLR_ERROR, "session-lock: wlr_scene_rect_create()"); -- 2.52.0