mirror of
https://github.com/libretro/RetroArch.git
synced 2024-12-13 20:33:22 +00:00
Merge pull request #1712 from heuripedes/master
(config_file.c) Fix error when path is not a regular file
This commit is contained in:
commit
52e8d582c0
@ -362,9 +362,16 @@ static config_file_t *config_file_new_internal(
|
||||
if (!conf)
|
||||
return NULL;
|
||||
|
||||
if (!path)
|
||||
if (!path || !*path)
|
||||
return conf;
|
||||
|
||||
if (path_is_directory(path))
|
||||
{
|
||||
RARCH_ERR("%s is not a regular file.\n", path);
|
||||
free(conf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
conf->path = strdup(path);
|
||||
if (!conf->path)
|
||||
{
|
||||
@ -411,6 +418,11 @@ static config_file_t *config_file_new_internal(
|
||||
|
||||
free(line);
|
||||
}
|
||||
else
|
||||
{
|
||||
free(list);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (list != conf->tail)
|
||||
free(list);
|
||||
|
Loading…
Reference in New Issue
Block a user