From e2065b361594e72dd30e4f660bfcb077416f1927 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 16 Mar 2017 00:15:10 +0200 Subject: [PATCH] auth: oauth2 - Make sure db_oauth2_request.req is set to NULL when it 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. --- src/auth/db-oauth2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/auth/db-oauth2.c b/src/auth/db-oauth2.c index 09bc86c03f..ed16795177 100644 --- a/src/auth/db-oauth2.c +++ b/src/auth/db-oauth2.c @@ -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; @@ -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; @@ -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 ? -- 2.47.3