From: Gunnar Beutner Date: Tue, 3 Mar 2015 06:36:43 +0000 (+0100) Subject: Fix file descriptor leak in SetDaemonIO X-Git-Tag: v2.3.0~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac7a55cf56f1ce5ebe3671a37c0a44c7a5ada5c3;p=icinga2 Fix file descriptor leak in SetDaemonIO --- diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 503c83a89..f82071b5c 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -134,7 +134,7 @@ static bool SetDaemonIO(const String& stderrFile) if (fderr < 0 && errno == ENOENT) fderr = open(errPath, O_CREAT | O_WRONLY | O_APPEND, 0600); - if (fderr > 0) { + if (fderr >= 0) { if (fderr != 2) dup2(fderr, 2);