[nginx] Proxy: use an appropriate error on memory allocation fai...

Ruslan Ermilov ru at nginx.com
Thu Mar 5 06:17:21 UTC 2015


details:   http://hg.nginx.org/nginx/rev/cf2f8d91cf09
branches:  
changeset: 6003:cf2f8d91cf09
user:      Ruslan Ermilov <ru at nginx.com>
date:      Wed Mar 04 08:12:53 2015 +0300
description:
Proxy: use an appropriate error on memory allocation failure.

diffstat:

 src/http/modules/ngx_http_proxy_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r f8ee988cfe6d -r cf2f8d91cf09 src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c	Wed Mar 04 08:10:40 2015 +0300
+++ b/src/http/modules/ngx_http_proxy_module.c	Wed Mar 04 08:12:53 2015 +0300
@@ -812,7 +812,7 @@ ngx_http_proxy_handler(ngx_http_request_
 
     ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_proxy_ctx_t));
     if (ctx == NULL) {
-        return NGX_ERROR;
+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }
 
     ngx_http_set_ctx(r, ctx, ngx_http_proxy_module);



More information about the nginx-devel mailing list