mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
(menu/cbs/menu_cbs_ok.c) Try to fix memory leak
This commit is contained in:
parent
096ca1851b
commit
8644e8e26b
@ -633,6 +633,7 @@ static int action_ok_playlist_entry_collection(const char *path,
|
||||
menu_content_ctx_playlist_info_t playlist_info;
|
||||
size_t selection_ptr = 0;
|
||||
playlist_t *playlist = NULL;
|
||||
bool playlist_initialized = false;
|
||||
bool is_history = true;
|
||||
const char *entry_path = NULL;
|
||||
const char *entry_label = NULL;
|
||||
@ -655,6 +656,7 @@ static int action_ok_playlist_entry_collection(const char *path,
|
||||
|
||||
if (!tmp_playlist)
|
||||
return menu_cbs_exit();
|
||||
playlist_initialized = true;
|
||||
}
|
||||
|
||||
playlist = tmp_playlist;
|
||||
@ -692,8 +694,13 @@ static int action_ok_playlist_entry_collection(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