Fix resource leak, variable fd going out of scope.

Reported by:	Coverity
CID:		1204383
Sponsored by:	iXsystems Inc.
This commit is contained in:
Marcelo Araujo 2018-11-02 07:59:28 +00:00
parent ea2c655dd9
commit 6c8dae3cba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340043

View File

@ -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);
}