From 461e4c7e6ca31a47a0dcc020c74074e6d2c81f08 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sat, 17 Sep 2016 12:57:00 +0300 Subject: [PATCH] auth-policy: Ref/unref auth request If auth_request is not referenced it can go away before HTTP response is handled. --- src/auth/auth-policy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/auth/auth-policy.c b/src/auth/auth-policy.c index 2f7b4caea7..78443d54af 100755 --- a/src/auth/auth-policy.c +++ b/src/auth/auth-policy.c @@ -227,6 +227,8 @@ void auth_policy_finish(void *ctx) } if (context->http_request != NULL) http_client_request_abort(&(context->http_request)); + if (context->request != NULL) + auth_request_unref(&context->request); } static @@ -391,6 +393,7 @@ void auth_policy_send_request(struct policy_lookup_ctx *context) http_client_request_set_payload(context->http_request, is, FALSE); i_stream_unref(&is); http_client_request_submit(context->http_request); + auth_request_ref(context->request); } static