Skip to content

Commit

Permalink
prevent memory leak in init of jwks_provider->jwks_uri->endpoint->url
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Feb 10, 2025
1 parent cfbd27a commit 32d46a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/jose.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,13 @@ _OAUTH_CFG_CTX_CALLBACK(oauth2_jose_verify_options_jwk_set_aws_alb)
goto end;

oauth2_jose_jwt_verify_ctx_t *ptr = verify->ctx->ptr;

// this is going to be set dynamically
if (ptr->jwks_provider->jwks_uri->endpoint->url) {
oauth2_mem_free(ptr->jwks_provider->jwks_uri->endpoint->url);
ptr->jwks_provider->jwks_uri->endpoint->url = NULL;
}

ptr->jwks_provider->alb_arn = oauth2_strdup(value);

alb_base_url = oauth2_nv_list_get(log, params, "alb_base_url");
Expand Down

0 comments on commit 32d46a0

Please sign in to comment.