Accept NULL files in load_files[_section] as we do in constructor
authorMartin Willi <martin@revosec.ch>
Tue, 12 Apr 2011 09:15:54 +0000 (11:15 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 15 Apr 2011 08:07:13 +0000 (10:07 +0200)
src/libstrongswan/settings.c

index c26a74a..8a2248b 100644 (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;