# HG changeset patch # User Maxim Dounin # Date 1403739253 -14400 # Node ID b490bfbf8cfa2a18cb87ce84407317f6ccc98108 # Parent 4440438eb086533cb0d23af4c098fe489750ab9b Fixed wrong sizeof() in ngx_http_init_locations(). There is no real difference on all known platforms, but it's still wrong. Found by Coverity (CID 400876). diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -742,7 +742,7 @@ ngx_http_init_locations(ngx_conf_t *cf, 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, 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; }