Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2019 18:20:56 +0000 (UTC)
From:      Sean Chittenden <seanc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349946 - head/usr.sbin/bhyve
Message-ID:  <201907121820.x6CIKu1c030704@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907121820.x6CIKu1c030704>