From: Markus Valentin Date: Tue, 7 Apr 2020 10:56:46 +0000 (+0200) Subject: auth: mech-otp: Add mech_otp_deinit and call it in main_deinit X-Git-Tag: 2.3.11.2~171 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7dae801a81f263e6fd5c508880c363cee2c04c5;p=thirdparty%2Fdovecot%2Fcore.git auth: mech-otp: Add mech_otp_deinit and call it in main_deinit This change make sure the otp_lock_table is destroyed on deinit. --- diff --git a/src/auth/main.c b/src/auth/main.c index c7d7e6252c..647003bbc7 100644 --- a/src/auth/main.c +++ b/src/auth/main.c @@ -19,6 +19,8 @@ #include "password-scheme.h" #include "passdb-cache.h" #include "mech.h" +#include "otp.h" +#include "mech-otp-skey-common.h" #include "auth.h" #include "auth-penalty.h" #include "auth-token.h" @@ -280,6 +282,7 @@ static void main_deinit(void) auth_policy_deinit(); mech_register_deinit(&mech_reg); + mech_otp_deinit(); mech_deinit(global_auth_settings); /* allow modules to unregister their dbs/drivers/etc. before freeing diff --git a/src/auth/mech-otp-skey-common.c b/src/auth/mech-otp-skey-common.c index 1e20fc07b1..b20951e197 100644 --- a/src/auth/mech-otp-skey-common.c +++ b/src/auth/mech-otp-skey-common.c @@ -64,3 +64,8 @@ void mech_otp_skey_auth_free(struct auth_request *auth_request) pool_unref(&auth_request->pool); } + +void mech_otp_deinit(void) +{ + hash_table_destroy(&otp_lock_table); +} diff --git a/src/auth/mech-otp-skey-common.h b/src/auth/mech-otp-skey-common.h index 91f60f4aa8..ca64c810b9 100644 --- a/src/auth/mech-otp-skey-common.h +++ b/src/auth/mech-otp-skey-common.h @@ -18,5 +18,6 @@ void otp_unlock(struct auth_request *auth_request); void otp_set_credentials_callback(bool success, struct auth_request *auth_request); void mech_otp_skey_auth_free(struct auth_request *auth_request); +void mech_otp_deinit(void); #endif