diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index dd6db96110..f182c62cba 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -476,6 +476,24 @@ static bool parse_line(config_file_t *conf, return true; } +config_file_t *config_file_new_alloc(void) +{ + struct config_file *conf = (struct config_file*)malloc(sizeof(*conf)); + if (!conf) + return NULL; + + conf->path = NULL; + conf->entries = NULL; + conf->tail = NULL; + conf->last = NULL; + conf->includes = NULL; + conf->include_depth = 0; + conf->guaranteed_no_duplicates = false; + conf->modified = false; + + return conf; +} + static config_file_t *config_file_new_internal( const char *path, unsigned depth, config_file_cb_t *cb) { @@ -717,24 +735,6 @@ config_file_t *config_file_new(const char *path) return config_file_new_internal(path, 0, NULL); } -config_file_t *config_file_new_alloc(void) -{ - struct config_file *conf = (struct config_file*)malloc(sizeof(*conf)); - if (!conf) - return NULL; - - conf->path = NULL; - conf->entries = NULL; - conf->tail = NULL; - conf->last = NULL; - conf->includes = NULL; - conf->include_depth = 0; - conf->guaranteed_no_duplicates = false; - conf->modified = false; - - return conf; -} - struct config_entry_list *config_get_entry( const config_file_t *conf, const char *key, struct config_entry_list **prev)