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
862e8ad26b
commit
c1d34a7231
@ -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 New Issue
Block a user