Merge pull request #1712 from heuripedes/master

(config_file.c) Fix error when path is not a regular file
This commit is contained in:
Twinaphex 2015-05-20 16:16:03 +02:00
commit 52e8d582c0

View File

@ -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);