comparison src/http/ngx_http_variables.c @ 3345:d8228f0b5113

evaluate maximum captures size on configuration phase
author Igor Sysoev <igor@sysoev.ru>
date Mon, 16 Nov 2009 19:11:38 +0000
parents 1aed55182ea2
children fe08c14530e9
comparison
equal deleted inserted replaced
3344:1aed55182ea2 3345:d8228f0b5113
1757 ngx_http_core_main_conf_t *cmcf; 1757 ngx_http_core_main_conf_t *cmcf;
1758 1758
1759 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); 1759 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
1760 1760
1761 if (re->ncaptures) { 1761 if (re->ncaptures) {
1762 len = (cmcf->ncaptures + 1) * 3; 1762 len = cmcf->ncaptures;
1763 1763
1764 if (r->captures == NULL) { 1764 if (r->captures == NULL) {
1765 r->captures = ngx_palloc(r->pool, len * sizeof(int)); 1765 r->captures = ngx_palloc(r->pool, len * sizeof(int));
1766 if (r->captures == NULL) { 1766 if (r->captures == NULL) {
1767 return NGX_ERROR; 1767 return NGX_ERROR;