Accept NULL files in load_files[_section] as we do in constructor

This commit is contained in:
Martin Willi
2011-04-15 10:07:13 +02:00
parent 32973044b0
commit fd3c12bf06
+5 -5
View File
@@ -1119,6 +1119,11 @@ static bool load_files_internal(private_settings_t *this, section_t *parent,
linked_list_t *contents = linked_list_create();
section_t *section = section_create(NULL);
if (pattern == NULL)
{
pattern = STRONGSWAN_CONF;
}
if (!parse_files(contents, NULL, 0, pattern, section))
{
contents->destroy_function(contents, (void*)free);
@@ -1207,11 +1212,6 @@ settings_t *settings_create(char *file)
.lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
);
if (file == NULL)
{
file = STRONGSWAN_CONF;
}
load_files(this, file, FALSE);
return &this->public;