From: Nick Porter Date: Tue, 25 Mar 2025 09:22:29 +0000 (+0000) Subject: Handle un-used rlm_cache instances using htrie driver X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f55c4d153d24af940e4d1b59283aecb1053c56c0;p=thirdparty%2Ffreeradius-server.git Handle un-used rlm_cache instances using htrie driver When a module instance using the htrie driver is not used in policy, and has it's type set to `auto`, it will still have htype FR_HTRIE_AUTO when the module is instantiated. In this case, exit driver instantiation early. --- diff --git a/src/modules/rlm_cache/drivers/rlm_cache_htrie/rlm_cache_htrie.c b/src/modules/rlm_cache/drivers/rlm_cache_htrie/rlm_cache_htrie.c index ace9d9b8cd2..ef69d050f4d 100644 --- a/src/modules/rlm_cache/drivers/rlm_cache_htrie/rlm_cache_htrie.c +++ b/src/modules/rlm_cache/drivers/rlm_cache_htrie/rlm_cache_htrie.c @@ -432,6 +432,12 @@ static int mod_instantiate(module_inst_ctx_t const *mctx) rlm_cache_htrie_mutable_t *mutable; int ret; + /* + * An instance with htype of FR_HTRIE_AUTO has not been used + * in any policy - so instantiation can be short circuited. + */ + if (driver->htype == FR_HTRIE_AUTO) return 0; + MEM(mutable = talloc_zero(NULL, rlm_cache_htrie_mutable_t)); /*