Skip to content

Commit

Permalink
auth: oauth2 - Make sure db_oauth2_request.req is set to NULL when it…
Browse files Browse the repository at this point in the history
… gets freed.

Doesn't fix anything, but makes it clearer that req->req must not be
aborted anymore after this stage, because it gets freed anyway.
  • Loading branch information
sirainen committed Mar 16, 2017
1 parent 68df507 commit e2065b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/auth/db-oauth2.c
Expand Up @@ -506,6 +506,8 @@ static void
db_oauth2_introspect_continue(struct oauth2_introspection_result *result,
struct db_oauth2_request *req)
{
req->req = NULL;

if (!result->success) {
/* fail here */
req->failed = TRUE;
Expand All @@ -519,7 +521,6 @@ db_oauth2_introspect_continue(struct oauth2_introspection_result *result,
static void db_oauth2_lookup_introspect(struct db_oauth2_request *req)
{
struct oauth2_request_input input;
i_assert(req->req != NULL);
i_zero(&input);

input.token = req->token;
Expand All @@ -541,6 +542,8 @@ static void
db_oauth2_lookup_continue(struct oauth2_token_validation_result *result,
struct db_oauth2_request *req)
{
req->req = NULL;

if (!result->success || !result->valid) {
/* no point going forward */
req->result = result->success ?
Expand Down

0 comments on commit e2065b3

Please sign in to comment.