mirror of
https://github.com/nginx/nginx.git
synced 2024-12-03 04:39:00 +08:00
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).
This commit is contained in:
parent
e5e6e606e6
commit
1a5cdafa82
@ -411,12 +411,10 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
|
|||||||
if (bind(s, ls[i].sockaddr, ls[i].socklen) == -1) {
|
if (bind(s, ls[i].sockaddr, ls[i].socklen) == -1) {
|
||||||
err = ngx_socket_errno;
|
err = ngx_socket_errno;
|
||||||
|
|
||||||
if (err == NGX_EADDRINUSE && ngx_test_config) {
|
if (err != NGX_EADDRINUSE || !ngx_test_config) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_EMERG, log, err,
|
ngx_log_error(NGX_LOG_EMERG, log, err,
|
||||||
"bind() to %V failed", &ls[i].addr_text);
|
"bind() to %V failed", &ls[i].addr_text);
|
||||||
|
}
|
||||||
|
|
||||||
if (ngx_close_socket(s) == -1) {
|
if (ngx_close_socket(s) == -1) {
|
||||||
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
|
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
|
||||||
@ -428,7 +426,9 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
|
|||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ngx_test_config) {
|
||||||
failed = 1;
|
failed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user