]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/osd.c: Free buf.buf as its malloc'd in buf_init()
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Thu, 26 May 2022 13:39:51 +0000 (15:39 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 26 May 2022 21:19:56 +0000 (22:19 +0100)
src/osd.c

index 79febfb08d3c9e5fe87a92a2d3c1a72b58e8b6a4..08faccc312debfa829e6494cb1c6c340b95bb587 100644 (file)
--- 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);
 }