This commit is contained in:
twinaphex 2017-05-14 20:23:10 +02:00
parent 0e34d362d3
commit 9e26332c48

View File

@ -715,29 +715,21 @@ static bool content_file_init_set_attribs(
**/ **/
static bool content_file_init( static bool content_file_init(
content_information_ctx_t *content_ctx, content_information_ctx_t *content_ctx,
struct string_list *content,
char **error_string) char **error_string)
{ {
struct retro_game_info *info = NULL; struct retro_game_info *info = NULL;
struct string_list *content = NULL; bool ret =
bool ret = path_is_empty(RARCH_PATH_SUBSYSTEM) path_is_empty(RARCH_PATH_SUBSYSTEM)
? true : false; ? true : false;
const struct retro_subsystem_info *special = path_is_empty(RARCH_PATH_SUBSYSTEM) const struct retro_subsystem_info *special =
path_is_empty(RARCH_PATH_SUBSYSTEM)
? NULL : content_file_init_subsystem(content_ctx, error_string, &ret); ? NULL : content_file_init_subsystem(content_ctx, error_string, &ret);
if (!ret) if ( !ret ||
!content_file_init_set_attribs(content, special, content_ctx, error_string))
return false; return false;
content = string_list_new();
if (!content)
return false;
if (!content_file_init_set_attribs(content, special, content_ctx, error_string))
{
string_list_free(content);
return false;
}
info = (struct retro_game_info*) info = (struct retro_game_info*)
calloc(content->size, sizeof(*info)); calloc(content->size, sizeof(*info));
@ -755,8 +747,6 @@ static bool content_file_init(
free(info); free(info);
} }
string_list_free(content);
return ret; return ret;
} }
@ -1699,6 +1689,7 @@ bool content_init(void)
bool ret = true; bool ret = true;
char *error_string = NULL; char *error_string = NULL;
struct string_list *content = NULL;
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info(); rarch_system_info_t *sys_info = runloop_get_system_info();
@ -1755,15 +1746,18 @@ bool content_init(void)
} }
_content_is_inited = true; _content_is_inited = true;
content = string_list_new();
if ( !temporary_content if ( !temporary_content
|| !content_file_init(&content_ctx, &error_string)) || !content_file_init(&content_ctx, content, &error_string))
{ {
content_deinit(); content_deinit();
ret = false; ret = false;
} }
string_list_free(content);
if (content_ctx.name_ips) if (content_ctx.name_ips)
free(content_ctx.name_ips); free(content_ctx.name_ips);
if (content_ctx.name_bps) if (content_ctx.name_bps)