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

(cherry picked from commit bc928800723b65daa9b005bec4ffd8ad8c781a09)

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
rGcee36581281d: bhyve: Appease warning about a potentially unaligned pointer.
Branches
Unknown
Tags
Unknown