From 2725185aeba3ae5dd4ab129158cb4677a8a63042 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sun, 1 Jul 2018 23:40:20 +0900 Subject: swaylock daemonize: fix leak of devnull fd --- swaylock/main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'swaylock/main.c') diff --git a/swaylock/main.c b/swaylock/main.c index 591df7b4..f31ed679 100644 --- a/swaylock/main.c +++ b/swaylock/main.c @@ -42,6 +42,7 @@ static void daemonize() { int devnull = open("/dev/null", O_RDWR); dup2(STDOUT_FILENO, devnull); dup2(STDERR_FILENO, devnull); + close(devnull); uint8_t success = 0; if (chdir("/") != 0) { write(fds[1], &success, 1); -- cgit v1.2.3