]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: auth - Perform per-auth free in separate auth_free() function
authorStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 27 Feb 2025 20:57:53 +0000 (21:57 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 9 Oct 2025 08:41:22 +0000 (08:41 +0000)
src/auth/auth.c

index 27b3307a3e46083476ec51c8a5640f126fb778ff..59d14ea1b2e6d5221c1ade4c30751c9605811947 100644 (file)
@@ -406,6 +406,12 @@ static void auth_deinit(struct auth *auth)
        dns_client_deinit(&auth->dns_client);
 }
 
+static void auth_free(struct auth *auth)
+{
+       settings_free(auth->protocol_set);
+       pool_unref(&auth->pool);
+}
+
 static void
 auth_passdbs_update_md5(struct auth *auth, struct md5_context *ctx)
 {
@@ -567,9 +573,7 @@ void auths_free(void)
 {
        struct auth *auth;
 
-       array_foreach_elem(&auths, auth) {
-               settings_free(auth->protocol_set);
-               pool_unref(&auth->pool);
-       }
+       array_foreach_elem(&auths, auth)
+               auth_free(auth);
        array_free(&auths);
 }