From: Aki Tuomi Date: Tue, 6 Aug 2019 05:44:18 +0000 (+0300) Subject: auth: Do not unref policy payload too early X-Git-Tag: 2.3.8~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0bf30fbde398036eb41e0b69ef997237ae4e65ff;p=thirdparty%2Fdovecot%2Fcore.git auth: Do not unref policy payload too early This can cause the context to be free'd too early leading to crashes. --- diff --git a/src/auth/auth-policy.c b/src/auth/auth-policy.c index 9efc81330d..6318db8bf7 100644 --- a/src/auth/auth-policy.c +++ b/src/auth/auth-policy.c @@ -347,7 +347,6 @@ void auth_policy_parse_response(struct policy_lookup_ctx *context) else if (context->parse_state == POLICY_RESULT) context->parse_error = FALSE; } - i_stream_unref(&context->payload); if (context->parse_error) { context->result = (context->set->policy_reject_on_fail ? -1 : 0); @@ -376,6 +375,7 @@ void auth_policy_parse_response(struct policy_lookup_ctx *context) } auth_policy_callback(context); + i_stream_unref(&context->payload); } static