mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
Merge pull request #1117 from mprobinson/use-after-free
Fix use-after-free
This commit is contained in:
commit
e7f5112044
@ -108,8 +108,11 @@ void file_list_clear(file_list_t *list)
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
free(list->list[i].path);
|
||||
list->list[i].path = NULL;
|
||||
free(list->list[i].label);
|
||||
list->list[i].label = NULL;
|
||||
free(list->list[i].alt);
|
||||
list->list[i].alt = NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
|
@ -411,12 +411,15 @@ static int menu_settings_iterate(unsigned action)
|
||||
file_list_get_at_offset(driver.menu->selection_buf,
|
||||
driver.menu->selection_ptr, NULL, &label, &type);
|
||||
|
||||
if (!strcmp(label, "core_list"))
|
||||
dir = g_settings.libretro_directory;
|
||||
else if (!strcmp(label, "configurations"))
|
||||
dir = g_settings.menu_config_directory;
|
||||
else if (!strcmp(label, "disk_image_append"))
|
||||
dir = g_settings.menu_content_directory;
|
||||
if (label)
|
||||
{
|
||||
if (!strcmp(label, "core_list"))
|
||||
dir = g_settings.libretro_directory;
|
||||
else if (!strcmp(label, "configurations"))
|
||||
dir = g_settings.menu_config_directory;
|
||||
else if (!strcmp(label, "disk_image_append"))
|
||||
dir = g_settings.menu_content_directory;
|
||||
}
|
||||
|
||||
if (driver.menu->need_refresh && action != MENU_ACTION_MESSAGE)
|
||||
action = MENU_ACTION_NOOP;
|
||||
|
Loading…
x
Reference in New Issue
Block a user