Fixed a potential descriptor leak if mmap() failed.

This commit is contained in:
Valentin Bartenev
2021-10-26 19:31:43 +03:00
parent 7bf6253941
commit 561dbeb98d

View File

@@ -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;
}