Mercurial > hg > nginx
comparison src/http/ngx_http.c @ 5741:b490bfbf8cfa
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).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 26 Jun 2014 03:34:13 +0400 |
parents | 3a72b1805c52 |
children | 1b8459a53e4b |
comparison
equal
deleted
inserted
replaced
5740:4440438eb086 | 5741:b490bfbf8cfa |
---|---|
740 ngx_queue_split(locations, q, &tail); | 740 ngx_queue_split(locations, q, &tail); |
741 } | 741 } |
742 | 742 |
743 if (named) { | 743 if (named) { |
744 clcfp = ngx_palloc(cf->pool, | 744 clcfp = ngx_palloc(cf->pool, |
745 (n + 1) * sizeof(ngx_http_core_loc_conf_t **)); | 745 (n + 1) * sizeof(ngx_http_core_loc_conf_t *)); |
746 if (clcfp == NULL) { | 746 if (clcfp == NULL) { |
747 return NGX_ERROR; | 747 return NGX_ERROR; |
748 } | 748 } |
749 | 749 |
750 cscf->named_locations = clcfp; | 750 cscf->named_locations = clcfp; |
766 #if (NGX_PCRE) | 766 #if (NGX_PCRE) |
767 | 767 |
768 if (regex) { | 768 if (regex) { |
769 | 769 |
770 clcfp = ngx_palloc(cf->pool, | 770 clcfp = ngx_palloc(cf->pool, |
771 (r + 1) * sizeof(ngx_http_core_loc_conf_t **)); | 771 (r + 1) * sizeof(ngx_http_core_loc_conf_t *)); |
772 if (clcfp == NULL) { | 772 if (clcfp == NULL) { |
773 return NGX_ERROR; | 773 return NGX_ERROR; |
774 } | 774 } |
775 | 775 |
776 pclcf->regex_locations = clcfp; | 776 pclcf->regex_locations = clcfp; |