mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
(libretro-common) config_file.c - Cleanups
This commit is contained in:
parent
1f852fb23d
commit
2660606f41
@ -35,8 +35,6 @@
|
||||
#include <xtl.h>
|
||||
#endif
|
||||
|
||||
#include <retro_assert.h>
|
||||
#include <retro_log.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <compat/strl.h>
|
||||
#include <compat/posix_string.h>
|
||||
@ -373,18 +371,11 @@ static config_file_t *config_file_new_internal(
|
||||
return conf;
|
||||
|
||||
if (path_is_directory(path))
|
||||
{
|
||||
RARCH_ERR("%s is not a regular file.\n", path);
|
||||
free(conf);
|
||||
return NULL;
|
||||
}
|
||||
goto error;
|
||||
|
||||
conf->path = strdup(path);
|
||||
if (!conf->path)
|
||||
{
|
||||
free(conf);
|
||||
return NULL;
|
||||
}
|
||||
goto error;
|
||||
|
||||
conf->include_depth = depth;
|
||||
file = fopen(path, "r");
|
||||
@ -392,8 +383,7 @@ static config_file_t *config_file_new_internal(
|
||||
if (!file)
|
||||
{
|
||||
free(conf->path);
|
||||
free(conf);
|
||||
return NULL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
while (!feof(file))
|
||||
@ -434,9 +424,15 @@ static config_file_t *config_file_new_internal(
|
||||
if (list != conf->tail)
|
||||
free(list);
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
|
||||
return conf;
|
||||
|
||||
error:
|
||||
free(conf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
config_file_t *config_file_new_from_string(const char *from_string)
|
||||
|
Loading…
x
Reference in New Issue
Block a user