From bfb2f06c05ba8f28579a7cdc68758fc1de2b01c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 5 Sep 2017 11:07:01 +0200 Subject: [PATCH] fix resource leak The file descriptor used for dup'ing stdout and stderr is not closed. Found by coverity --- src/daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/daemon.c b/src/daemon.c index 7b9d52b..dbbf9a1 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -83,6 +83,8 @@ void daemonize(void) exit(EXIT_FAILURE); } + close(i); + umask(027); /* set newly created file permissions */ /* change running directory */ -- 2.40.0