aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_connection.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-06-26 03:34:05 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-06-26 03:34:05 +0400
commit1a5cdafa829b30a5b16a29bfb2a589d7ded04d65 (patch)
treefdc120e667d78deeb06b41a8d098ebad66a7ac03 /src/core/ngx_connection.c
parente5e6e606e633574e68b7a2cf70da8a97c0a83108 (diff)
downloadnginx-1a5cdafa829b30a5b16a29bfb2a589d7ded04d65.tar.gz
nginx-1a5cdafa829b30a5b16a29bfb2a589d7ded04d65.zip
Core: plugged socket leak during configuration test.
This isn't really important as configuration testing shortly ends with a process termination which will free all sockets, though Coverity complains. Prodded by Coverity (CID 400872).
Diffstat (limited to 'src/core/ngx_connection.c')
-rw-r--r--src/core/ngx_connection.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 6b6e3b3a5..4c42ffc0d 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -411,13 +411,11 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
if (bind(s, ls[i].sockaddr, ls[i].socklen) == -1) {
err = ngx_socket_errno;
- if (err == NGX_EADDRINUSE && ngx_test_config) {
- continue;
+ if (err != NGX_EADDRINUSE || !ngx_test_config) {
+ ngx_log_error(NGX_LOG_EMERG, log, err,
+ "bind() to %V failed", &ls[i].addr_text);
}
- ngx_log_error(NGX_LOG_EMERG, log, err,
- "bind() to %V failed", &ls[i].addr_text);
-
if (ngx_close_socket(s) == -1) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
ngx_close_socket_n " %V failed",
@@ -428,7 +426,9 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
return NGX_ERROR;
}
- failed = 1;
+ if (!ngx_test_config) {
+ failed = 1;
+ }
continue;
}