Fix use-after-free

label was freed at menu_entries.c:263, so do comparison first.