mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
testUpdateQEMUCaps: Fix memory leak
testUpdateQEMUCaps is called multiple times. Use virQEMUCapsUpdateHostCPUModel instead of virQEMUCapsInitHostCPUModel to not overwrite (and leak) the pointers in qemuCaps->kvm.hostCPU and qemuCaps->tcg.hostCPU. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
903c4d0a53
commit
25af3e6ceb
@ -367,10 +367,10 @@ testUpdateQEMUCaps(const struct testQemuInfo *info,
|
|||||||
!!(info->flags & FLAG_SKIP_LEGACY_CPUS)) < 0)
|
!!(info->flags & FLAG_SKIP_LEGACY_CPUS)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
|
virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||||
VIR_DOMAIN_VIRT_KVM);
|
VIR_DOMAIN_VIRT_KVM);
|
||||||
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
|
virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||||
VIR_DOMAIN_VIRT_QEMU);
|
VIR_DOMAIN_VIRT_QEMU);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user