]> git.kaiwu.me - nginx.git/commitdiff
Fixed wrong sizeof() in ngx_http_init_locations().
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 25 Jun 2014 23:34:13 +0000 (03:34 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 25 Jun 2014 23:34:13 +0000 (03:34 +0400)
There is no real difference on all known platforms, but it's still wrong.

Found by Coverity (CID 400876).

src/http/ngx_http.c

index ce5adb7374a30efa0df264f542aea530494f23bc..31577f9a28e571506fe70624941f01e80ff8f20c 100644 (file)
@@ -742,7 +742,7 @@ ngx_http_init_locations(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
 
     if (named) {
         clcfp = ngx_palloc(cf->pool,
-                           (n + 1) * sizeof(ngx_http_core_loc_conf_t **));
+                           (n + 1) * sizeof(ngx_http_core_loc_conf_t *));
         if (clcfp == NULL) {
             return NGX_ERROR;
         }
@@ -768,7 +768,7 @@ ngx_http_init_locations(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
     if (regex) {
 
         clcfp = ngx_palloc(cf->pool,
-                           (r + 1) * sizeof(ngx_http_core_loc_conf_t **));
+                           (r + 1) * sizeof(ngx_http_core_loc_conf_t *));
         if (clcfp == NULL) {
             return NGX_ERROR;
         }