Set cached pointers before using them
authorAlan T. DeKok <aland@freeradius.org>
Wed, 29 Apr 2015 20:49:51 +0000 (16:49 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 29 Apr 2015 20:49:51 +0000 (16:49 -0400)
src/modules/rlm_sql/rlm_sql.c

index 552e7ae..f17b067 100644 (file)
@@ -811,6 +811,12 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
 {
        rlm_sql_t *inst = instance;
 
+       /*
+        *      Hack...
+        */
+       inst->config = &inst->myconfig;
+       inst->cs = conf;
+
        if (inst->config->groupmemb_query) {
                if (!cf_section_name2(conf)) {
                        char buffer[256];
@@ -846,12 +852,6 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
 {
        rlm_sql_t *inst = instance;
 
-       /*
-        *      Hack...
-        */
-       inst->config = &inst->myconfig;
-       inst->cs = conf;
-
        inst->name = cf_section_name2(conf);
        if (!inst->name) {
                inst->name = cf_section_name1(conf);