diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-05-29 11:42:55 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-05-29 11:42:55 +0000 |
commit | 8416832621e8d427f399bbe2b085c12e74a7808f (patch) | |
tree | 94b11aecc9975e7f8236bdf98fcc5ec366e9d706 /src/http/ngx_http_request.c | |
parent | 6da803a6be92a54cbc5135b6b47c4ca7b0523c5f (diff) | |
download | nginx-8416832621e8d427f399bbe2b085c12e74a7808f.tar.gz nginx-8416832621e8d427f399bbe2b085c12e74a7808f.zip |
fix "out of memory" case handling
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 4e799e96a..be5c91cbf 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -451,13 +451,15 @@ ngx_http_init_request(ngx_event_t *rev) sizeof(ngx_table_elt_t)) != NGX_OK) { - ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + ngx_destroy_pool(r->pool); + ngx_http_close_connection(c); return; } r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module); if (r->ctx == NULL) { - ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + ngx_destroy_pool(r->pool); + ngx_http_close_connection(c); return; } @@ -466,7 +468,8 @@ ngx_http_init_request(ngx_event_t *rev) r->variables = ngx_pcalloc(r->pool, cmcf->variables.nelts * sizeof(ngx_http_variable_value_t)); if (r->variables == NULL) { - ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + ngx_destroy_pool(r->pool); + ngx_http_close_connection(c); return; } |