[PATCH] virQEMUCapsReset: also clear out hostCPUModel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After succesfully reading an outdated caps cache from disk,
calling virQEMUCapsReset did not properly clear out the host
CPU model. This lead to a memory leak when the host CPU model
pointer was overwritten later in virQEMUCapsNewForBinaryInternal.

Introduced by commit 68c70118.
---
 src/qemu/qemu_capabilities.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 9132469..130f1db 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3430,6 +3430,9 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps)
 
     VIR_FREE(qemuCaps->gicCapabilities);
     qemuCaps->ngicCapabilities = 0;
+
+    virCPUDefFree(qemuCaps->hostCPUModel);
+    qemuCaps->hostCPUModel = NULL;
 }
 
 
-- 
2.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]