(config_file.c) Only attempt to load config file if it exists
This commit is contained in:
parent
5047d6e709
commit
35cdff8704
|
@ -603,6 +603,8 @@ config_file_t *config_file_new_from_path_to_string(const char *path)
|
||||||
uint8_t *ret_buf = NULL;
|
uint8_t *ret_buf = NULL;
|
||||||
config_file_t *conf = NULL;
|
config_file_t *conf = NULL;
|
||||||
|
|
||||||
|
if (path_is_valid(path))
|
||||||
|
{
|
||||||
if (filestream_read_file(path, (void**)&ret_buf, &length))
|
if (filestream_read_file(path, (void**)&ret_buf, &length))
|
||||||
{
|
{
|
||||||
if (length >= 0)
|
if (length >= 0)
|
||||||
|
@ -610,6 +612,7 @@ config_file_t *config_file_new_from_path_to_string(const char *path)
|
||||||
if ((void*)ret_buf)
|
if ((void*)ret_buf)
|
||||||
free((void*)ret_buf);
|
free((void*)ret_buf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return conf;
|
return conf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue