Accept NULL files in load_files[_section] as we do in constructor
This commit is contained in:
@@ -1119,6 +1119,11 @@ static bool load_files_internal(private_settings_t *this, section_t *parent,
|
|||||||
linked_list_t *contents = linked_list_create();
|
linked_list_t *contents = linked_list_create();
|
||||||
section_t *section = section_create(NULL);
|
section_t *section = section_create(NULL);
|
||||||
|
|
||||||
|
if (pattern == NULL)
|
||||||
|
{
|
||||||
|
pattern = STRONGSWAN_CONF;
|
||||||
|
}
|
||||||
|
|
||||||
if (!parse_files(contents, NULL, 0, pattern, section))
|
if (!parse_files(contents, NULL, 0, pattern, section))
|
||||||
{
|
{
|
||||||
contents->destroy_function(contents, (void*)free);
|
contents->destroy_function(contents, (void*)free);
|
||||||
@@ -1207,11 +1212,6 @@ settings_t *settings_create(char *file)
|
|||||||
.lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
|
.lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (file == NULL)
|
|
||||||
{
|
|
||||||
file = STRONGSWAN_CONF;
|
|
||||||
}
|
|
||||||
|
|
||||||
load_files(this, file, FALSE);
|
load_files(this, file, FALSE);
|
||||||
|
|
||||||
return &this->public;
|
return &this->public;
|
||||||
|
|||||||
Reference in New Issue
Block a user