aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2018-11-02 07:59:28 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2018-11-02 07:59:28 +0000
commit6c8dae3cbaf13c9d8083c9e1cbf42489662af899 (patch)
treec7acf7031faa16d2a79d8e99cfdec4cdc35e05fb /usr.sbin
parentea2c655dd9f56ffe7c12e1bac0e4498f630f60ed (diff)
downloadsrc-6c8dae3cbaf13c9d8083c9e1cbf42489662af899.tar.gz
src-6c8dae3cbaf13c9d8083c9e1cbf42489662af899.zip
Fix resource leak, variable fd going out of scope.
Reported by: Coverity CID: 1204383 Sponsored by: iXsystems Inc.
Notes
Notes: svn path=/head/; revision=340043
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/pci_virtio_rnd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_rnd.c b/usr.sbin/bhyve/pci_virtio_rnd.c
index 44bc55e0039e..e86fa549d8c5 100644
--- a/usr.sbin/bhyve/pci_virtio_rnd.c
+++ b/usr.sbin/bhyve/pci_virtio_rnd.c
@@ -168,6 +168,7 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
len = read(fd, &v, sizeof(v));
if (len <= 0) {
WPRINTF(("vtrnd: /dev/random not ready, read(): %d", len));
+ close(fd);
return (1);
}