From 39ea566d45dee37665389479e407922597458d67 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 3 Jan 2020 09:46:11 +0100 Subject: [PATCH] Fix minor descriptor leak, found by Coverity Scan It is safe to always close() the fd here. Signed-off-by: Joachim Nilsson --- src/syslogd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/syslogd.c b/src/syslogd.c index 9570e41..88299f0 100644 --- a/src/syslogd.c +++ b/src/syslogd.c @@ -2036,8 +2036,7 @@ static int waitdaemon(int maxwait) (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDERR_FILENO); - if (fd > STDERR_FILENO) - (void)close(fd); + (void)close(fd); } return getppid();