From 6478d20e550eaa11a4f98f59f0948c6d5c0d1fc3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 26 Aug 2020 18:43:19 +0200 Subject: [PATCH] (core_info/UWP) Use non-heap based versions for string_list --- core_info.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/core_info.c b/core_info.c index 02f8a43c56..0ecebc9914 100644 --- a/core_info.c +++ b/core_info.c @@ -277,12 +277,16 @@ static core_info_list_t *core_info_list_new(const char *path, #if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP { /* UWP: browse the optional packages for additional cores */ - struct string_list *core_packages = string_list_new(); - uwp_fill_installed_core_packages(core_packages); - for (i = 0; i < core_packages->size; i++) - dir_list_append(&contents, core_packages->elems[i].data, exts, - false, dir_show_hidden_files, false, false); - string_list_free(core_packages); + struct string_list core_packages = {0}; + + if (string_list_initialize(&core_packages)) + { + uwp_fill_installed_core_packages(&core_packages); + for (i = 0; i < core_packages.size; i++) + dir_list_append(&contents, core_packages.elems[i].data, exts, + false, dir_show_hidden_files, false, false); + string_list_deinitialize(&core_packages); + } } #else /* Keep the old 'directory not found' behavior */