This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Commit 1701935
committed
Don't leak file descriptor in nxt_main_port_access_log_handler()
After opening a file and setting file.fd we _may_ call
nxt_port_socket_write(). If so then the file is eventually closed via
something like
nxt_port_socket_write()
nxt_port_socket_write2()
nxt_port_write_handler()
nxt_port_msg_close_fd()
nxt_port_close_fds()
Alternatively we may just return from the function and never close(2)
file.fd.
In which case we should call nxt_file_close().
This was reported by coverity.
Signed-off-by: Andrew Clayton <[email protected]>1 parent 5e97e44 commit 1701935
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1730 | 1730 | | |
1731 | 1731 | | |
1732 | 1732 | | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
1733 | 1736 | | |
1734 | 1737 | | |
0 commit comments