mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
Sub filter: fixed allocation alignment.
This commit is contained in:
parent
c3aed0a233
commit
3d791c46f5
@ -229,7 +229,7 @@ ngx_http_sub_header_filter(ngx_http_request_t *r)
|
|||||||
return ngx_http_next_header_filter(r);
|
return ngx_http_next_header_filter(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->matches = ngx_pnalloc(r->pool, sizeof(ngx_array_t));
|
ctx->matches = ngx_palloc(r->pool, sizeof(ngx_array_t));
|
||||||
if (ctx->matches == NULL) {
|
if (ctx->matches == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ ngx_http_sub_header_filter(ngx_http_request_t *r)
|
|||||||
ctx->matches->elts = matches;
|
ctx->matches->elts = matches;
|
||||||
ctx->matches->nelts = j;
|
ctx->matches->nelts = j;
|
||||||
|
|
||||||
ctx->tables = ngx_pnalloc(r->pool, sizeof(ngx_http_sub_tables_t));
|
ctx->tables = ngx_palloc(r->pool, sizeof(ngx_http_sub_tables_t));
|
||||||
if (ctx->tables == NULL) {
|
if (ctx->tables == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
@ -859,7 +859,7 @@ ngx_http_sub_merge_conf(ngx_conf_t *cf, void *parent, void *child)
|
|||||||
pairs = conf->pairs->elts;
|
pairs = conf->pairs->elts;
|
||||||
n = conf->pairs->nelts;
|
n = conf->pairs->nelts;
|
||||||
|
|
||||||
matches = ngx_pnalloc(cf->pool, sizeof(ngx_http_sub_match_t) * n);
|
matches = ngx_palloc(cf->pool, sizeof(ngx_http_sub_match_t) * n);
|
||||||
if (matches == NULL) {
|
if (matches == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
@ -869,7 +869,7 @@ ngx_http_sub_merge_conf(ngx_conf_t *cf, void *parent, void *child)
|
|||||||
matches[i].value = &pairs[i].value;
|
matches[i].value = &pairs[i].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
conf->matches = ngx_pnalloc(cf->pool, sizeof(ngx_array_t));
|
conf->matches = ngx_palloc(cf->pool, sizeof(ngx_array_t));
|
||||||
if (conf->matches == NULL) {
|
if (conf->matches == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user