From: Aki Tuomi Date: Fri, 16 May 2025 08:05:27 +0000 (+0300) Subject: lib-var-expand: Unload loaded crypt module at exit X-Git-Tag: 2.4.2~783 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3777ad53f4323cec6a9e4cb1c087da239f9c424;p=thirdparty%2Fdovecot%2Fcore.git lib-var-expand: Unload loaded crypt module at exit Forgotten in 73ae2a9e45144f05a179d17d9b201226d93b81a0 --- diff --git a/src/lib-var-expand/expansion-filter-crypt.c b/src/lib-var-expand/expansion-filter-crypt.c index 0cab9dd5d7..64b9b72262 100644 --- a/src/lib-var-expand/expansion-filter-crypt.c +++ b/src/lib-var-expand/expansion-filter-crypt.c @@ -10,6 +10,12 @@ static struct module *var_expand_crypt_module; static var_expand_filter_func_t *fn_encrypt = NULL; static var_expand_filter_func_t *fn_decrypt = NULL; +static void var_expand_crypt_unload(void) +{ + fn_decrypt = fn_encrypt = NULL; + module_dir_unload(&var_expand_crypt_module); +} + void var_expand_crypt_load(void) { struct module_dir_load_settings set = { @@ -23,6 +29,7 @@ void var_expand_crypt_load(void) var_expand_crypt_module = module_dir_load(VAR_EXPAND_MODULE_DIR, mods, &set); module_dir_init(var_expand_crypt_module); + lib_atexit(var_expand_crypt_unload); } void expansion_filter_crypt_set_functions(var_expand_filter_func_t *encrypt,