From 0af92cc92eef8adf2add8ab9bde08a9e98c2a353 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 11 Sep 2017 06:31:44 +0200 Subject: [PATCH] Reduce stack usage --- menu/cbs/menu_cbs_ok.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 87d08287df..844b50ae3d 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1034,8 +1034,8 @@ static int file_load_with_detect_core_wrapper( unsigned type, bool is_carchive) { menu_content_ctx_defer_info_t def_info; - char new_core_path[PATH_MAX_LENGTH]; char menu_path_new[PATH_MAX_LENGTH]; + char *new_core_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); int ret = 0; const char *menu_path = NULL; const char *menu_label = NULL; @@ -1071,9 +1071,11 @@ static int file_load_with_detect_core_wrapper( def_info.len = sizeof(menu->deferred_path); if (menu_content_find_first_core(&def_info, false, new_core_path, - sizeof(new_core_path))) + PATH_MAX_LENGTH * sizeof(char))) ret = -1; + free(new_core_path); + if ( !is_carchive && !string_is_empty(path) && !string_is_empty(menu_path_new)) fill_pathname_join(detect_content_path, menu_path_new, path,