Better handle variable that isn't in the module instance
authorAlan T. DeKok <aland@freeradius.org>
Wed, 15 Jul 2009 09:04:47 +0000 (11:04 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 15 Jul 2009 09:04:47 +0000 (11:04 +0200)
This kind of thing should be discouraged...

src/modules/rlm_sql/rlm_sql.c

index 4038ed1..abcea04 100644 (file)
@@ -821,7 +821,12 @@ static int rlm_sql_detach(void *instance)
                        free(*p);
                        *p = NULL;
                }
-               allowed_chars = NULL;
+               /*
+                *      Catch multiple instances of the module.
+                */
+               if (allowed_chars == inst->config->allowed_chars) {
+                       allowed_chars = NULL;
+               }
                free(inst->config);
                inst->config = NULL;
        }