Skip to content

Commit 66198ef

Browse files
committed
initialize cfg struct members to NULL
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 70142ed commit 66198ef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ngx_oauth2_module.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ static void *ngx_oauth2_create_loc_conf(ngx_conf_t *cf)
6060

6161
cfg = ngx_pnalloc(cf->pool, sizeof(ngx_oauth2_cfg_t));
6262
cfg->cf = cf;
63+
cfg->claims = NULL;
64+
cfg->verify = NULL;
65+
cfg->source_token.flushes = NULL;
66+
cfg->source_token.lengths = NULL;
67+
cfg->source_token.value.data = NULL;
68+
cfg->source_token.value.len = 0;
69+
cfg->source_token.values = NULL;
6370

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

345+
ngx_source_token.data = NULL;
346+
ngx_source_token.len = 0;
347+
338348
if (r != r->main)
339349
goto end;
340350

0 commit comments

Comments
 (0)