Skip to content

Commit

Permalink
auth-policy: Ref/unref auth request
Browse files Browse the repository at this point in the history
If auth_request is not referenced it can go away
before HTTP response is handled.
  • Loading branch information
cmouse committed Sep 17, 2016
1 parent 50072aa commit 609bea0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/auth/auth-policy.c
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 609bea0

Please sign in to comment.