comparison src/http/ngx_http.c @ 3257:8bd88de8fecd

fix segfault if http {} block is empty, the bug had been introduced in r3218
author Igor Sysoev <igor@sysoev.ru>
date Wed, 28 Oct 2009 10:45:40 +0000
parents a7491af45540
children 77db9440d970
comparison
equal deleted inserted replaced
3256:0df898363248 3257:8bd88de8fecd
1350 { 1350 {
1351 ngx_uint_t p, a; 1351 ngx_uint_t p, a;
1352 ngx_http_conf_port_t *port; 1352 ngx_http_conf_port_t *port;
1353 ngx_http_conf_addr_t *addr; 1353 ngx_http_conf_addr_t *addr;
1354 1354
1355 if (ports == NULL) {
1356 return NGX_OK;
1357 }
1358
1355 port = ports->elts; 1359 port = ports->elts;
1356 for (p = 0; p < ports->nelts; p++) { 1360 for (p = 0; p < ports->nelts; p++) {
1357 1361
1358 ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts, 1362 ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts,
1359 sizeof(ngx_http_conf_addr_t), ngx_http_cmp_conf_addrs); 1363 sizeof(ngx_http_conf_addr_t), ngx_http_cmp_conf_addrs);