mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
menu: fix UAF of server->menu_current
This fixes segfault when exiting with a menu opened, which is a regression
from eaf11fac.
This commit is contained in:
parent
77d1747f1b
commit
d5daee6b96
1 changed files with 4 additions and 0 deletions
|
|
@ -1140,6 +1140,10 @@ menu_free(struct menu *menu)
|
||||||
/* Keep items clean on pipemenu destruction */
|
/* Keep items clean on pipemenu destruction */
|
||||||
nullify_item_pointing_to_this_menu(menu);
|
nullify_item_pointing_to_this_menu(menu);
|
||||||
|
|
||||||
|
if (menu->server->menu_current == menu) {
|
||||||
|
menu_close_root(menu->server);
|
||||||
|
}
|
||||||
|
|
||||||
struct menuitem *item, *next;
|
struct menuitem *item, *next;
|
||||||
wl_list_for_each_safe(item, next, &menu->menuitems, link) {
|
wl_list_for_each_safe(item, next, &menu->menuitems, link) {
|
||||||
item_destroy(item);
|
item_destroy(item);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue