]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: oauth2 - Make sure db_oauth2_request.req is set to NULL when it gets freed.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 15 Mar 2017 22:15:10 +0000 (00:15 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 16 Mar 2017 17:42:56 +0000 (19:42 +0200)
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

index 09bc86c03ff5b6521b1c26bbd8cbecaf202a02da..ed167951773cc6b1a90aba31870644e3d90340d8 100644 (file)
@@ -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 ?