mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
tools/xenstored: Don't leak a file handle when creating the pidfile
Coverity ID: 1055849 Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> CC: Ian Campbell <Ian.Campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
05e243a6a0
commit
375b0e1bfb
1 file changed
+2
@@ -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. */
|
||||
|
||||