Skip to content

Commit

Permalink
initialize cfg struct members to NULL
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Sep 30, 2019
1 parent 70142ed commit 66198ef
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ngx_oauth2_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ static void *ngx_oauth2_create_loc_conf(ngx_conf_t *cf)

cfg = ngx_pnalloc(cf->pool, sizeof(ngx_oauth2_cfg_t));
cfg->cf = cf;
cfg->claims = NULL;
cfg->verify = NULL;
cfg->source_token.flushes = NULL;
cfg->source_token.lengths = NULL;
cfg->source_token.value.data = NULL;
cfg->source_token.value.len = 0;
cfg->source_token.values = NULL;

// TODO: correct level
// oauth2_log_t *log = oauth2_log_init(OAUTH2_LOG_TRACE1, NULL);
Expand Down Expand Up @@ -335,6 +342,9 @@ static ngx_int_t ngx_oauth2_handler(ngx_http_request_t *r)
char *source_token = NULL;
json_t *json_payload = NULL;

ngx_source_token.data = NULL;
ngx_source_token.len = 0;

if (r != r->main)
goto end;

Expand Down

0 comments on commit 66198ef

Please sign in to comment.