mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
macvtap: avoid invalid free
Commit 0472f39 plugged a leak, but introduced another bug: Actually looks like physfndev is conditionally allocated in getPhysfnDev Its better to modify getPhysfnDev to allocate physfndev every time.
This commit is contained in:
parent
4040ff6638
commit
80b077ee5e
@ -964,7 +964,11 @@ getPhysfnDev(const char *linkdev,
|
||||
*/
|
||||
|
||||
*vf = PORT_SELF_VF;
|
||||
*physfndev = (char *)linkdev;
|
||||
*physfndev = strdup(linkdev);
|
||||
if (!*physfndev) {
|
||||
virReportOOMError();
|
||||
rc = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user