From: Andrew Cooper Date: Mon, 25 Nov 2013 11:06:39 +0000 (+0000) Subject: tools/xenconsoled: Fix file handle leaks X-Git-Tag: 4.4.0-rc1~138 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9ab1792e1ce9e77afe2cd230d69e56a0737a735f;p=xen.git tools/xenconsoled: Fix file handle leaks Coverity ID: 715218 1055876 1055877 Signed-off-by: Andrew Cooper CC: Ian Campbell Acked-by: Ian Jackson --- diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 250550a612..007ecf41c3 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 aab6f425e8..71dd185b8e 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)