mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
bhyve: Avoid passing a possible garbage pointer to free().
All of the error paths in pci_vtcon_sock_add free the sock pointer. However, sock is not initialized until part way through the function. An early error would pass stack garbage to free(). Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37491
This commit is contained in:
parent
32b21dd271
commit
bc92880072
|
@ -273,7 +273,7 @@ static int
|
|||
pci_vtcon_sock_add(struct pci_vtcon_softc *sc, const char *port_name,
|
||||
const nvlist_t *nvl)
|
||||
{
|
||||
struct pci_vtcon_sock *sock;
|
||||
struct pci_vtcon_sock *sock = NULL;
|
||||
struct sockaddr_un sun;
|
||||
const char *name, *path;
|
||||
char *cp, *pathcopy;
|
||||
|
|
Loading…
Reference in a new issue