From: Aki Tuomi Date: Mon, 17 Oct 2016 16:38:07 +0000 (+0300) Subject: auth-policy: Use request's pool instead of new pool X-Git-Tag: 2.2.26~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d88f6e11c97d2b74de3e5343e82b4630f16157a2;p=thirdparty%2Fdovecot%2Fcore.git auth-policy: Use request's pool instead of new pool This fixes existing memory leak in auth_report, which is caused by using separate memory pool instead of request's pool. Thank you for Andrea Carpani for extensive debugging. --- diff --git a/src/auth/auth-policy.c b/src/auth/auth-policy.c index 78443d54af..d546c60d99 100755 --- a/src/auth/auth-policy.c +++ b/src/auth/auth-policy.c @@ -526,9 +526,8 @@ void auth_policy_report(struct auth_request *request) if (*(request->set->policy_server_url) == '\0') return; - pool_t pool = pool_alloconly_create("auth policy", 128); - struct policy_lookup_ctx *ctx = p_new(pool, struct policy_lookup_ctx, 1); - ctx->pool = pool; + struct policy_lookup_ctx *ctx = p_new(request->pool, struct policy_lookup_ctx, 1); + ctx->pool = request->pool; ctx->request = request; ctx->expect_result = FALSE; ctx->set = request->set;