(config_file.c) Fix error when path is not a regular file

This commit is contained in:
Higor Eurípedes 2015-05-20 10:02:33 -03:00
parent 533a0b7f7f
commit 317f481b95

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