mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Fix leak in x86UpdateHostModel
Commit de0aeaf introduced a memory leak.
This commit is contained in:
parent
288c47406c
commit
5b5631dedf
@ -2094,10 +2094,12 @@ x86UpdateHostModel(virCPUDefPtr guest,
|
|||||||
* features directly */
|
* features directly */
|
||||||
for (i = 0; i < guest->nfeatures; i++) {
|
for (i = 0; i < guest->nfeatures; i++) {
|
||||||
for (feat = map->migrate_blockers; feat; feat = feat->next) {
|
for (feat = map->migrate_blockers; feat; feat = feat->next) {
|
||||||
if (STREQ(feat->name, guest->features[i].name))
|
if (STREQ(feat->name, guest->features[i].name)) {
|
||||||
|
VIR_FREE(guest->features[i].name);
|
||||||
VIR_DELETE_ELEMENT_INPLACE(guest->features, i, guest->nfeatures);
|
VIR_DELETE_ELEMENT_INPLACE(guest->features, i, guest->nfeatures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < oldguest->nfeatures; i++) {
|
for (i = 0; i < oldguest->nfeatures; i++) {
|
||||||
if (virCPUDefUpdateFeature(guest,
|
if (virCPUDefUpdateFeature(guest,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user