From: Andrew Cooper Subject: [PATCH 2/2] tools/xenconsoled: Fix file handle leaks Date: Mon, 25 Nov 2013 11:06:39 +0000 Message-ID: <1385377599-20913-3-git-send-email-andrew.cooper3@citrix.com> References: <1385377599-20913-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1385377599-20913-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Coverity ID: 715218 1055876 1055877 Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson --- tools/console/daemon/io.c | 2 ++ tools/console/daemon/utils.c | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 250550a..007ecf4 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -278,6 +278,7 @@ static int create_hv_log(void) dolog(LOG_ERR, "Failed to log opening timestamp " "in %s: %d (%s)", logfile, errno, strerror(errno)); + close(fd); return -1; } } @@ -323,6 +324,7 @@ static int create_domain_log(struct domain *dom) dolog(LOG_ERR, "Failed to log opening timestamp " "in %s: %d (%s)", logfile, errno, strerror(errno)); + close(fd); return -1; } } diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c index aab6f42..71dd185 100644 --- a/tools/console/daemon/utils.c +++ b/tools/console/daemon/utils.c @@ -104,6 +104,7 @@ void daemonize(const char *pidfile) signal(SIGTSTP, SIG_IGN); signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); + close(fd); } bool xen_setup(void) -- 1.7.10.4