mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Fix use-after-close in service.c:redirect(), found by Coverity Scan
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+2
-1
@@ -171,7 +171,6 @@ static void redirect(svc_t *svc)
|
||||
|
||||
dup2(fd, STDOUT_FILENO);
|
||||
dup2(fd, STDERR_FILENO);
|
||||
close(fd);
|
||||
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
@@ -206,6 +205,8 @@ static void redirect(svc_t *svc)
|
||||
execlp("logit", "logit", "-t", tag, "-p", prio, NULL);
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
} else if (log_is_debug()) {
|
||||
int fd;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user