HomeFreeBSD

bhyve: Avoid passing a possible garbage pointer to free().

Description

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

Details

Provenance
jhbAuthored on Nov 29 2022, 1:10 AM
Reviewer
corvink
Differential Revision
D37491: bhyve: Avoid passing a possible garbage pointer to free().
Parents
rG32b21dd2719f: bhyve: Appease warning about a potentially unaligned pointer.
Branches
Unknown
Tags
Unknown