1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

bridge: leases: Fix potential crash caused by use after free

Don't free individual JSON array members as the array will be freed at
the end. This may potentially lead to a crash although it didn't crash
on my setup.
This commit is contained in:
Peter Krempa 2014-06-24 13:52:57 +02:00
parent 15b46520e5
commit 11863f7067

View File

@ -3437,10 +3437,8 @@ networkGetDHCPLeasesHelper(virNetworkObjPtr obj,
goto error;
}
if (mac && virMacAddrCompare(mac, mac_tmp)) {
virJSONValueFree(lease_tmp);
if (mac && virMacAddrCompare(mac, mac_tmp))
continue;
}
if (virJSONValueObjectGetNumberLong(lease_tmp, "expiry-time", &expirytime_tmp) < 0) {
/* A lease cannot be present without expiry-time */