Maxim Dounin
June 25, 2014 08:14PM
details: http://hg.nginx.org/nginx/rev/4440438eb086
branches:
changeset: 5740:4440438eb086
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Jun 26 03:34:05 2014 +0400
description:
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:

src/core/ngx_connection.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diffs (31 lines):

diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -411,13 +411,11 @@ ngx_open_listening_sockets(ngx_cycle_t *
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 *
return NGX_ERROR;
}

- failed = 1;
+ if (!ngx_test_config) {
+ failed = 1;
+ }

continue;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Core: plugged socket leak during configuration test.

Maxim Dounin 433 June 25, 2014 08:14PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready