Fixed ETag memory allocation error handling.
The etag->hash must be set to 0 to avoid an empty ETag header being returned with the 500 Internal Server Error page after the memory allocation failure. Reported by Markus Linnala.
This commit is contained in:
parent
e87cb56698
commit
a09aacf2b0
|
@ -1837,6 +1837,7 @@ ngx_http_set_etag(ngx_http_request_t *r)
|
|||
|
||||
etag->value.data = ngx_pnalloc(r->pool, NGX_OFF_T_LEN + NGX_TIME_T_LEN + 3);
|
||||
if (etag->value.data == NULL) {
|
||||
etag->hash = 0;
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue