mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
(menu_cbs_ok.c) Try to fix second memory leak
This commit is contained in:
parent
8644e8e26b
commit
462dda944c
@ -744,6 +744,7 @@ static int action_ok_playlist_entry(const char *path,
|
||||
size_t selection;
|
||||
menu_content_ctx_playlist_info_t playlist_info;
|
||||
size_t selection_ptr = 0;
|
||||
bool playlist_initialized = false;
|
||||
playlist_t *playlist = g_defaults.history;
|
||||
bool is_history = true;
|
||||
const char *entry_path = NULL;
|
||||
@ -772,6 +773,7 @@ static int action_ok_playlist_entry(const char *path,
|
||||
|
||||
if (!tmp_playlist)
|
||||
return menu_cbs_exit();
|
||||
playlist_initialized = true;
|
||||
}
|
||||
|
||||
playlist = tmp_playlist;
|
||||
@ -818,8 +820,13 @@ static int action_ok_playlist_entry(const char *path,
|
||||
found_associated_core = false;
|
||||
|
||||
if (!found_associated_core)
|
||||
return action_ok_file_load_with_detect_core(entry_path,
|
||||
{
|
||||
int ret = action_ok_file_load_with_detect_core(entry_path,
|
||||
label, type, selection_ptr, entry_idx);
|
||||
if (playlist_initialized)
|
||||
playlist_free(tmp_playlist);
|
||||
return ret;
|
||||
}
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user