]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: mech-otp: Add mech_otp_deinit and call it in main_deinit
authorMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 7 Apr 2020 10:56:46 +0000 (12:56 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 24 Apr 2020 12:00:22 +0000 (12:00 +0000)
This change make sure the otp_lock_table is destroyed on deinit.

src/auth/main.c
src/auth/mech-otp-skey-common.c
src/auth/mech-otp-skey-common.h

index c7d7e6252c204a922a9899a6cc3acb53bb5be160..647003bbc7687ca665f81c30ee5e91c119727378 100644 (file)
@@ -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
index 1e20fc07b15529c96b2ba893c83ab6a0cdbbe977..b20951e1970449b0b0304ee40e5fcfce7e5b2c9e 100644 (file)
@@ -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);
+}
index 91f60f4aa8726b466eedbccf69147ab77513a973..ca64c810b9433267f573f7efbf3a8abd101e14e8 100644 (file)
@@ -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