Mercurial > hg > nginx
comparison src/http/modules/ngx_http_charset_filter_module.c @ 2912:c7d57b539248
return NULL instead of NGX_CONF_ERROR on a create conf failure
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 02 Jun 2009 16:09:44 +0000 |
parents | 76dfc19dcd49 |
children | 6b8e5c882e47 |
comparison
equal
deleted
inserted
replaced
2911:32b444fa2ca4 | 2912:c7d57b539248 |
---|---|
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 * |