Skip to content

Commit

Permalink
use ngx_pcalloc instead of ngx_pnalloc to align memory access
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Jun 3, 2021
1 parent f2ec454 commit 3309c78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
06/03/2021
- use ngx_pcalloc instead of ngx_pnalloc to align memory access

12/22/2020
- depend on liboauth2 1.4.0
- release 3.2.0
Expand Down
4 changes: 2 additions & 2 deletions src/ngx_oauth2_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void *ngx_oauth2_create_loc_conf(ngx_conf_t *cf)
ngx_oauth2_cfg_t *cfg = NULL;
ngx_pool_cleanup_t *cln = NULL;

cfg = ngx_pnalloc(cf->pool, sizeof(ngx_oauth2_cfg_t));
cfg = ngx_pcalloc(cf->pool, sizeof(ngx_oauth2_cfg_t));
cfg->log = NULL;
cfg->cf = cf;
cfg->claims = NULL;
Expand Down Expand Up @@ -141,7 +141,7 @@ static char *ngx_oauth2_set_claim(ngx_conf_t *cf, ngx_command_t *cmd,

value = cf->args->elts;

claim = ngx_pnalloc(cf->pool, sizeof(ngx_oauth_claim_t));
claim = ngx_pcalloc(cf->pool, sizeof(ngx_oauth_claim_t));
claim->name = oauth2_strndup((const char *)value[1].data, value[1].len);
claim->value = NULL;

Expand Down

0 comments on commit 3309c78

Please sign in to comment.