Date: Fri, 2 Nov 2018 07:59:28 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340043 - head/usr.sbin/bhyve Message-ID: <201811020759.wA27xSgS033976@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Fri Nov 2 07:59:28 2018 New Revision: 340043 URL: https://svnweb.freebsd.org/changeset/base/340043 Log: Fix resource leak, variable fd going out of scope. Reported by: Coverity CID: 1204383 Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Fri Nov 2 07:57:28 2018 (r340042) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Fri Nov 2 07:59:28 2018 (r340043) @@ -168,6 +168,7 @@ pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst * len = read(fd, &v, sizeof(v)); if (len <= 0) { WPRINTF(("vtrnd: /dev/random not ready, read(): %d", len)); + close(fd); return (1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811020759.wA27xSgS033976>