From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH 4/4] tools/xenstored: Don't leak a file handle when creating the pidfile Date: Mon, 25 Nov 2013 11:07:44 +0000 Message-ID: <1385377664-20979-5-git-send-email-andrew.cooper3@citrix.com> References: <1385377664-20979-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: <1385377664-20979-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: 1055849 Signed-off-by: Andrew Cooper CC: Ian Campbell CC: Ian Jackson --- tools/xenstore/xenstored_posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_posix.c index 25bdf74..0c93e6d 100644 --- a/tools/xenstore/xenstored_posix.c +++ b/tools/xenstore/xenstored_posix.c @@ -44,6 +44,8 @@ void write_pidfile(const char *pidfile) len = snprintf(buf, sizeof(buf), "%ld\n", (long)getpid()); if (write(fd, buf, len) != len) barf_perror("Writing pid file %s", pidfile); + + close(fd); } /* Stevens. */ -- 1.7.10.4