Fix memory leak, from Emmanuel Ugwu in GitHub issue 4900.

This commit is contained in:
nicm
2026-03-02 08:38:23 +00:00
parent 5413953d30
commit 9e804202b6

1
menu.c
View File

@@ -90,6 +90,7 @@ menu_add_item(struct menu *menu, const struct menu_item *item,
else
s = format_single(qitem, item->name, c, NULL, NULL, NULL);
if (*s == '\0') { /* no item if empty after format expanded */
free(s);
menu->count--;
return;
}