From ae9314c65eafea243520fa4c0564305f25ae40fa Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Thu, 26 May 2022 15:39:51 +0200 Subject: [PATCH] src/osd.c: Free buf.buf as its malloc'd in buf_init() --- src/osd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd.c b/src/osd.c index 79febfb0..08faccc3 100644 --- a/src/osd.c +++ b/src/osd.c @@ -103,6 +103,8 @@ osd_update(struct server *server) struct theme *theme = server->theme; + struct buf buf; + buf_init(&buf); struct output *output; wl_list_for_each(output, &server->outputs, link) { destroy_osd_nodes(output); @@ -168,10 +170,7 @@ osd_update(struct server *server) pango_cairo_update_layout(cairo, layout); - struct buf buf; - buf_init(&buf); y = OSD_BORDER_WIDTH; - y += (OSD_ITEM_HEIGHT - font_height(&font)) / 2; wl_list_for_each(view, &server->views, link) { @@ -221,4 +220,5 @@ osd_update(struct server *server) wlr_scene_node_set_position(&scene_buffer->node, lx, ly); wlr_scene_node_set_enabled(&output->osd_tree->node, true); } + free(buf.buf); } -- 2.52.0