summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/changes.xml21
-rw-r--r--src/nxt_port_socket.c18
2 files changed, 32 insertions, 7 deletions
diff --git a/docs/changes.xml b/docs/changes.xml
index ec8d4981..2af2fc90 100644
--- a/docs/changes.xml
+++ b/docs/changes.xml
@@ -31,6 +31,20 @@ NGINX Unit updated to 1.25.0.
date="" time=""
packager="Andrei Belov <defan@nginx.com>">
+<change type="bugfix">
+<para>
+the router process could crash on TLS connection open when multiple listeners
+with TLS certificate configured; the bug had appeared in 1.23.0.
+</para>
+</change>
+
+<change type="bugfix">
+<para>
+a descriptor and memory leak occurred in the router process when an app
+process stopped or crashed.
+</para>
+</change>
+
</changes>
@@ -44,13 +58,6 @@ Initial release of Java 17 module for NGINX Unit.
</para>
</change>
-<change type="bugfix">
-<para>
-the router process could crash on TLS connection open when multiple listeners
-with TLS certificate configured; the bug had appeared in 1.23.0.
-</para>
-</change>
-
</changes>
diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c
index 3cf2e79a..843728a4 100644
--- a/src/nxt_port_socket.c
+++ b/src/nxt_port_socket.c
@@ -524,6 +524,24 @@ next_fragment:
} else {
if (nxt_slow_path(n == NXT_ERROR)) {
+ if (msg->link.next == NULL) {
+ if (msg->close_fd) {
+ if (msg->fd[0] != -1) {
+ nxt_fd_close(msg->fd[0]);
+
+ msg->fd[0] = -1;
+ }
+
+ if (msg->fd[1] != -1) {
+ nxt_fd_close(msg->fd[1]);
+
+ msg->fd[1] = -1;
+ }
+ }
+
+ nxt_port_release_send_msg(msg);
+ }
+
goto fail;
}