summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_process.c')
-rw-r--r--src/nxt_process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nxt_process.c b/src/nxt_process.c
index 4d0241ec..f1c00e4e 100644
--- a/src/nxt_process.c
+++ b/src/nxt_process.c
@@ -299,6 +299,8 @@ nxt_process_daemon(nxt_task_t *task)
nxt_pid_t pid;
const char *msg;
+ fd = -1;
+
/*
* fork() followed by a parent process's exit() detaches a child process
* from an init script or terminal shell process which has started the
@@ -372,6 +374,10 @@ fail:
nxt_log(task, NXT_LOG_CRIT, msg, nxt_errno);
+ if (fd != -1) {
+ nxt_fd_close(fd);
+ }
+
return NXT_ERROR;
}