Don't free config data manually.
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 21:12:43 +0000 (16:12 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 21:15:04 +0000 (16:15 -0500)
src/modules/rlm_sqlcounter/rlm_sqlcounter.c

index 25f6193..4157adc 100644 (file)
@@ -661,33 +661,10 @@ static rlm_rcode_t sqlcounter_authorize(void *instance, REQUEST *request)
 
 static int sqlcounter_detach(void *instance)
 {
-       int i;
-       char **p;
        rlm_sqlcounter_t *inst = (rlm_sqlcounter_t *)instance;
 
        paircompare_unregister(inst->dict_attr->attr, sqlcounter_cmp);
 
-       /*
-        *      Free up dynamically allocated string pointers.
-        */
-       for (i = 0; module_config[i].name != NULL; i++) {
-               if (module_config[i].type != PW_TYPE_STRING_PTR) {
-                       continue;
-               }
-
-               /*
-                *      Treat 'config' as an opaque array of bytes,
-                *      and take the offset into it.  There's a
-                *      (char*) pointer at that offset, and we want
-                *      to point to it.
-                */
-               p = (char **) (((char *)inst) + module_config[i].offset);
-               if (!*p) { /* nothing allocated */
-                       continue;
-               }
-               free(*p);
-               *p = NULL;
-       }
        free(inst);
        return 0;
 }