From 466df258d8dde1856d202d2af46f6e532efde7b0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 12 Sep 2017 05:09:56 +0200 Subject: [PATCH] Fix use after free --- menu/cbs/menu_cbs_ok.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 9bc1ee0247..b0ce5b8410 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1075,7 +1075,6 @@ static int file_load_with_detect_core_wrapper( PATH_MAX_LENGTH * sizeof(char))) ret = -1; - free(new_core_path); if ( !is_carchive && !string_is_empty(path) && !string_is_empty(menu_path_new)) @@ -1105,14 +1104,20 @@ static int file_load_with_detect_core_wrapper( &content_info, CORE_TYPE_PLAIN, NULL, NULL)) + { + free(new_core_path); return -1; + } + free(new_core_path); return 0; } case 0: + free(new_core_path); return generic_action_ok_displaylist_push(path, NULL, label, type, idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST); default: + free(new_core_path); break; } }