mirror of
https://github.com/nginx/nginx.git
synced 2026-07-09 10:26:43 +00:00
Headers filter: improved memory allocation error handling.
This commit is contained in:
parent
f74e1ea995
commit
887d51938f
1 changed files with 4 additions and 0 deletions
|
|
@ -377,6 +377,7 @@ ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
|
|||
|
||||
cc = ngx_list_push(&r->headers_out.headers);
|
||||
if (cc == NULL) {
|
||||
e->hash = 0;
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -410,6 +411,8 @@ ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
|
|||
|
||||
e->value.data = ngx_pnalloc(r->pool, len);
|
||||
if (e->value.data == NULL) {
|
||||
e->hash = 0;
|
||||
cc->hash = 0;
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -447,6 +450,7 @@ ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
|
|||
cc->value.data = ngx_pnalloc(r->pool,
|
||||
sizeof("max-age=") + NGX_TIME_T_LEN + 1);
|
||||
if (cc->value.data == NULL) {
|
||||
cc->hash = 0;
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue