mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +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)
|
||||
return -1;
|
||||
|
||||
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||
VIR_DOMAIN_VIRT_KVM);
|
||||
virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||
VIR_DOMAIN_VIRT_QEMU);
|
||||
virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||
VIR_DOMAIN_VIRT_KVM);
|
||||
virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch,
|
||||
VIR_DOMAIN_VIRT_QEMU);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user