mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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;
|
*vf = PORT_SELF_VF;
|
||||||
*physfndev = (char *)linkdev;
|
*physfndev = strdup(linkdev);
|
||||||
|
if (!*physfndev) {
|
||||||
|
virReportOOMError();
|
||||||
|
rc = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user