From: Stephan Bosch Date: Thu, 27 Feb 2025 20:57:53 +0000 (+0100) Subject: auth: auth - Perform per-auth free in separate auth_free() function X-Git-Tag: 2.4.2~235 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=420ada46f554ed60b14de753abde9e019fa112ff;p=thirdparty%2Fdovecot%2Fcore.git auth: auth - Perform per-auth free in separate auth_free() function --- diff --git a/src/auth/auth.c b/src/auth/auth.c index 27b3307a3e..59d14ea1b2 100644 --- a/src/auth/auth.c +++ b/src/auth/auth.c @@ -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); }