mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 15:15:01 +00:00
usr.sbin/bhyve: free resources when erroring out of pci_vtcon_sock_add()
Coverity CID: 1362880 Approved by: markj, jhb Differential Revision: https://reviews.freebsd.org/D20916
This commit is contained in:
parent
cb84aeda17
commit
ba1ca6d2e3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349946
|
@ -356,8 +356,11 @@ pci_vtcon_sock_add(struct pci_vtcon_softc *sc, const char *name,
|
|||
if (fd != -1)
|
||||
close(fd);
|
||||
|
||||
if (error != 0 && s != -1)
|
||||
close(s);
|
||||
if (error != 0) {
|
||||
if (s != -1)
|
||||
close(s);
|
||||
free(sock);
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue