summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/changes.xml6
-rw-r--r--src/nxt_port_memory.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/changes.xml b/docs/changes.xml
index 02a8653f..b8c76089 100644
--- a/docs/changes.xml
+++ b/docs/changes.xml
@@ -9,6 +9,12 @@
date="" time=""
packager="Andrei Belov <defan@nginx.com>">
+<change type="bugfix">
+<para>
+a descriptor leak occurring in the router process when removing or
+reconfiguring an application; the bug had appeared in 1.19.0.
+</para>
+</change>
</changes>
diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c
index ae9f079c..bffae8a1 100644
--- a/src/nxt_port_memory.c
+++ b/src/nxt_port_memory.c
@@ -34,6 +34,10 @@ nxt_port_mmap_handler_use(nxt_port_mmap_handler_t *mmap_handler, int i)
mmap_handler->hdr = NULL;
}
+ if (mmap_handler->fd != -1) {
+ nxt_fd_close(mmap_handler->fd);
+ }
+
nxt_free(mmap_handler);
}
}
@@ -238,6 +242,7 @@ nxt_port_incoming_port_mmap(nxt_task_t *task, nxt_process_t *process,
}
mmap_handler->hdr = hdr;
+ mmap_handler->fd = -1;
if (nxt_slow_path(hdr->src_pid != process->pid
|| hdr->dst_pid != nxt_pid))