From f99f8c7beb4c1d7c519cb48b6222f6e3c946020c Mon Sep 17 00:00:00 2001 From: Mike Robinson <mikeprobinsonuk@gmail.com> Date: Sun, 12 Oct 2014 02:09:58 +0100 Subject: [PATCH] Fix use-after-free label was freed at menu_entries.c:263, so do comparison first. --- frontend/menu/menu_entries.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index ebc3fb9feb..d6acd48234 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -180,6 +180,7 @@ int menu_entries_push_list(menu_handle_t *menu, char tmp[PATH_MAX]; size_t list_size = 0; bool do_action = false; + bool is_history_list = !strcmp(label, "history_list"); #if 0 RARCH_LOG("Label is: %s\n", label); @@ -526,7 +527,7 @@ int menu_entries_push_list(menu_handle_t *menu, if (do_action) { driver.menu->scroll_indices_size = 0; - if (strcmp(label, "history_list") != 0) + if (is_history_list) menu_build_scroll_indices(list); entries_refresh(list);