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:
Sean Chittenden 2019-07-12 18:20:56 +00:00
parent cb84aeda17
commit ba1ca6d2e3

View File

@ -356,8 +356,11 @@ out:
if (fd != -1)
close(fd);
if (error != 0 && s != -1)
close(s);
if (error != 0) {
if (s != -1)
close(s);
free(sock);
}
return (error);
}