]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth-policy: Use request's pool instead of new pool
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 17 Oct 2016 16:38:07 +0000 (19:38 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 19 Oct 2016 12:39:41 +0000 (15:39 +0300)
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.

src/auth/auth-policy.c

index 78443d54af44aea017db3f8e35edff159d7cf4ac..d546c60d990f637856e1447ea108d2b71572b0ff 100755 (executable)
@@ -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;