]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
actually free the cache
authorAlan T. DeKok <aland@freeradius.org>
Fri, 25 Jul 2025 07:37:54 +0000 (09:37 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 25 Jul 2025 07:37:54 +0000 (09:37 +0200)
src/modules/rlm_dpsk/rlm_dpsk.c

index fa3b2766751def4d94015c0863d339779a94d66d..d84c7b09aac93ab2d5722c9f523aad3c95e80e24 100644 (file)
@@ -993,17 +993,20 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
        return 0;
 }
 
-#ifdef HAVE_PTHREAD_H
 static int mod_detach(void *instance)
 {
        rlm_dpsk_t *inst = instance;
 
        if (!inst->cache_size) return 0;
 
+       rbtree_free(inst->cache);
+
+#ifdef HAVE_PTHREAD_H
        pthread_mutex_destroy(&inst->mutex);
+#endif
+
        return 0;
 }
-#endif
 
 /*
  *     The module name should be the only globally exported symbol.
@@ -1023,9 +1026,7 @@ module_t rlm_dpsk = {
        .config         = module_config,
        .bootstrap      = mod_bootstrap,
        .instantiate    = mod_instantiate,
-#ifdef HAVE_PTHREAD_H
        .detach         = mod_detach,
-#endif
        .methods = {
                [MOD_AUTHORIZE]         = mod_authorize,
                [MOD_AUTHENTICATE]      = mod_authenticate,