comparison src/http/modules/ngx_http_charset_filter_module.c @ 3237:2efa8d2fcde1 stable-0.7

merge r2903, r2911, r2912, r3002: fix various failures handling
author Igor Sysoev <igor@sysoev.ru>
date Mon, 26 Oct 2009 15:54:29 +0000
parents 042124063e3d
children
comparison
equal deleted inserted replaced
3236:9aa8fd2d5a00 3237:2efa8d2fcde1
1486 { 1486 {
1487 ngx_http_charset_main_conf_t *mcf; 1487 ngx_http_charset_main_conf_t *mcf;
1488 1488
1489 mcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_main_conf_t)); 1489 mcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_main_conf_t));
1490 if (mcf == NULL) { 1490 if (mcf == NULL) {
1491 return NGX_CONF_ERROR; 1491 return NULL;
1492 } 1492 }
1493 1493
1494 if (ngx_array_init(&mcf->charsets, cf->pool, 2, sizeof(ngx_http_charset_t)) 1494 if (ngx_array_init(&mcf->charsets, cf->pool, 2, sizeof(ngx_http_charset_t))
1495 != NGX_OK) 1495 != NGX_OK)
1496 { 1496 {
1497 return NGX_CONF_ERROR; 1497 return NULL;
1498 } 1498 }
1499 1499
1500 if (ngx_array_init(&mcf->tables, cf->pool, 1, 1500 if (ngx_array_init(&mcf->tables, cf->pool, 1,
1501 sizeof(ngx_http_charset_tables_t)) 1501 sizeof(ngx_http_charset_tables_t))
1502 != NGX_OK) 1502 != NGX_OK)
1503 { 1503 {
1504 return NGX_CONF_ERROR; 1504 return NULL;
1505 } 1505 }
1506 1506
1507 if (ngx_array_init(&mcf->recodes, cf->pool, 2, 1507 if (ngx_array_init(&mcf->recodes, cf->pool, 2,
1508 sizeof(ngx_http_charset_recode_t)) 1508 sizeof(ngx_http_charset_recode_t))
1509 != NGX_OK) 1509 != NGX_OK)
1510 { 1510 {
1511 return NGX_CONF_ERROR; 1511 return NULL;
1512 } 1512 }
1513 1513
1514 return mcf; 1514 return mcf;
1515 } 1515 }
1516 1516
1520 { 1520 {
1521 ngx_http_charset_loc_conf_t *lcf; 1521 ngx_http_charset_loc_conf_t *lcf;
1522 1522
1523 lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_loc_conf_t)); 1523 lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_loc_conf_t));
1524 if (lcf == NULL) { 1524 if (lcf == NULL) {
1525 return NGX_CONF_ERROR; 1525 return NULL;
1526 } 1526 }
1527 1527
1528 /* 1528 /*
1529 * set by ngx_pcalloc(): 1529 * set by ngx_pcalloc():
1530 * 1530 *