]> git.kaiwu.me - nginx.git/commitdiff
fix segfault if http {} block is empty, the bug had been introduced in r3218
authorIgor Sysoev <igor@sysoev.ru>
Wed, 28 Oct 2009 10:45:40 +0000 (10:45 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 28 Oct 2009 10:45:40 +0000 (10:45 +0000)
src/http/ngx_http.c

index 99ccef934887178fca733a8e06afecf2996d48c7..534fabf1b8047fb031083e40575a29634123b7d1 100644 (file)
@@ -1352,6 +1352,10 @@ ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
     ngx_http_conf_port_t  *port;
     ngx_http_conf_addr_t  *addr;
 
+    if (ports == NULL) {
+        return NGX_OK;
+    }
+
     port = ports->elts;
     for (p = 0; p < ports->nelts; p++) {