]> git.mdlowis.com Git - proto/labwc.git/commitdiff
menu: fix leak in update_client_send_to_menu()
authorJohan Malm <jgm323@gmail.com>
Wed, 13 Aug 2025 20:37:51 +0000 (21:37 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 16 Aug 2025 13:54:48 +0000 (14:54 +0100)
src/menu/menu.c

index f610c1c3b3abaab00ad1b12f447ea2d049e3314a..8e3c004a363c209e496d22bd6b15c462d5d3c295 100644 (file)
@@ -844,8 +844,8 @@ update_client_send_to_menu(struct server *server)
         * <action name="SendToDesktop"><follow> is true by default so
         * GoToDesktop will be called as part of the action.
         */
+       struct buf buf = BUF_INIT;
        wl_list_for_each(workspace, &server->workspaces.all, link) {
-               struct buf buf = BUF_INIT;
                if (workspace == server->workspaces.current) {
                        buf_add_fmt(&buf, ">%s<", workspace->name);
                } else {
@@ -859,6 +859,7 @@ update_client_send_to_menu(struct server *server)
 
                buf_clear(&buf);
        }
+       buf_reset(&buf);
 
        separator_create(menu, "");
        struct menuitem *item = item_create(menu,