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 */