mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
conf: fix memleak in virDomainHostdevDefClear
use virNetworkRouteDefFree() instead of VIR_FREE to free routes, otherwise the element 'family' would not be freed. Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
parent
7e3faa0959
commit
d38d3c25f4
@ -1882,7 +1882,7 @@ void virDomainHostdevDefClear(virDomainHostdevDefPtr def)
|
||||
VIR_FREE(def->source.caps.u.net.ips[i]);
|
||||
VIR_FREE(def->source.caps.u.net.ips);
|
||||
for (i = 0; i < def->source.caps.u.net.nroutes; i++)
|
||||
VIR_FREE(def->source.caps.u.net.routes[i]);
|
||||
virNetworkRouteDefFree(def->source.caps.u.net.routes[i]);
|
||||
VIR_FREE(def->source.caps.u.net.routes);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user