mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03: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…
Reference in New Issue
Block a user