From 5b9cacc2d72c4b7a53685f15876ecdf11f9f4d54 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 23 Oct 2016 19:55:58 +0900 Subject: [PATCH] nghttpx: Discard iaddrs early --- src/shrpx.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index 668fa881..8e1a7273 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -1245,14 +1245,16 @@ int event_loop() { redirect_stderr_to_errorlog(); } - auto iaddrs = get_inherited_addr_from_env(config); + { + auto iaddrs = get_inherited_addr_from_env(config); - if (create_acceptor_socket(config, iaddrs) != 0) { - return -1; + if (create_acceptor_socket(config, iaddrs) != 0) { + return -1; + } + + close_unused_inherited_addr(iaddrs); } - close_unused_inherited_addr(iaddrs); - auto loop = ev_default_loop(config->ev_loop_flags); int ipc_fd;