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.
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 4071b61..3b36f4a 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c
@@ -1837,6 +1837,7 @@ 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; }