diff options
author | Valentin Bartenev <vbart@nginx.com> | 2021-10-26 19:31:43 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2021-10-26 19:31:43 +0300 |
commit | 561dbeb98d2574804c0918ae088a8f5a41418afb (patch) | |
tree | 3be5f80b3321b34f8849a3697ac50684a48d55a3 | |
parent | 7bf6253941d3b61e5eb3339fb5f68c84e9e68795 (diff) | |
download | unit-561dbeb98d2574804c0918ae088a8f5a41418afb.tar.gz unit-561dbeb98d2574804c0918ae088a8f5a41418afb.tar.bz2 |
Fixed a potential descriptor leak if mmap() failed.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_port_memory.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c index bffae8a1..ab2f826f 100644 --- a/src/nxt_port_memory.c +++ b/src/nxt_port_memory.c @@ -318,6 +318,7 @@ nxt_port_new_port_mmap(nxt_task_t *task, nxt_port_mmaps_t *mmaps, MAP_SHARED, fd, 0); if (nxt_slow_path(mem == MAP_FAILED)) { + nxt_fd_close(fd); goto remove_fail; } |