svn commit: r349946 - head/usr.sbin/bhyve
Sean Chittenden
seanc at FreeBSD.org
Fri Jul 12 18:20:57 UTC 2019
Author: seanc (ports committer)
Date: Fri Jul 12 18:20:56 2019
New Revision: 349946
URL: https://svnweb.freebsd.org/changeset/base/349946
Log:
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
Modified:
head/usr.sbin/bhyve/pci_virtio_console.c
Modified: head/usr.sbin/bhyve/pci_virtio_console.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_console.c Fri Jul 12 18:17:35 2019 (r349945)
+++ head/usr.sbin/bhyve/pci_virtio_console.c Fri Jul 12 18:20:56 2019 (r349946)
@@ -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);
}
More information about the svn-src-head
mailing list