mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +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++)
|
for (i = 0; i < list->size; i++)
|
||||||
{
|
{
|
||||||
free(list->list[i].path);
|
free(list->list[i].path);
|
||||||
|
list->list[i].path = NULL;
|
||||||
free(list->list[i].label);
|
free(list->list[i].label);
|
||||||
|
list->list[i].label = NULL;
|
||||||
free(list->list[i].alt);
|
free(list->list[i].alt);
|
||||||
|
list->list[i].alt = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
|
@ -411,12 +411,15 @@ static int menu_settings_iterate(unsigned action)
|
|||||||
file_list_get_at_offset(driver.menu->selection_buf,
|
file_list_get_at_offset(driver.menu->selection_buf,
|
||||||
driver.menu->selection_ptr, NULL, &label, &type);
|
driver.menu->selection_ptr, NULL, &label, &type);
|
||||||
|
|
||||||
if (!strcmp(label, "core_list"))
|
if (label)
|
||||||
dir = g_settings.libretro_directory;
|
{
|
||||||
else if (!strcmp(label, "configurations"))
|
if (!strcmp(label, "core_list"))
|
||||||
dir = g_settings.menu_config_directory;
|
dir = g_settings.libretro_directory;
|
||||||
else if (!strcmp(label, "disk_image_append"))
|
else if (!strcmp(label, "configurations"))
|
||||||
dir = g_settings.menu_content_directory;
|
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)
|
if (driver.menu->need_refresh && action != MENU_ACTION_MESSAGE)
|
||||||
action = MENU_ACTION_NOOP;
|
action = MENU_ACTION_NOOP;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user