comparison src/http/ngx_http_request.c @ 2556:8ec97ff12a0a

fix segfaults introduced in r2549 and r2550
author Igor Sysoev <igor@sysoev.ru>
date Wed, 11 Mar 2009 13:04:02 +0000
parents 0cf6662e4448
children a7443674e429
comparison
equal deleted inserted replaced
2555:0408f34ef7ea 2556:8ec97ff12a0a
1660 1660
1661 for (i = 0; i < vn->nregex; i++) { 1661 for (i = 0; i < vn->nregex; i++) {
1662 1662
1663 if (sn[i].captures && r->captures == NULL) { 1663 if (sn[i].captures && r->captures == NULL) {
1664 1664
1665 ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int); 1665 ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3;
1666 1666
1667 r->captures = ngx_palloc(r->pool, ncaptures); 1667 r->captures = ngx_palloc(r->pool, ncaptures * sizeof(int));
1668 if (r->captures == NULL) { 1668 if (r->captures == NULL) {
1669 return NGX_ERROR; 1669 return NGX_ERROR;
1670 } 1670 }
1671 1671
1672 if (server == buf) { 1672 if (server == buf) {