diff src/http/modules/ngx_http_limit_req_module.c @ 4811:21d1e3bcb356

Added three missing checks for NULL after ngx_array_push() calls. Found by Coverity.
author Valentin Bartenev <vbart@nginx.com>
date Wed, 08 Aug 2012 12:03:46 +0000
parents 778ef9c3fd2d
children 949ea3d3cd1a
line wrap: on
line diff
--- a/src/http/modules/ngx_http_limit_req_module.c
+++ b/src/http/modules/ngx_http_limit_req_module.c
@@ -937,6 +937,9 @@ ngx_http_limit_req(ngx_conf_t *cf, ngx_c
     }
 
     limit = ngx_array_push(&lrcf->limits);
+    if (limit == NULL) {
+        return NGX_CONF_ERROR;
+    }
 
     limit->shm_zone = shm_zone;
     limit->burst = burst * 1000;