]> xenbits.xensource.com Git - libvirt.git/commitdiff
virQEMUCapsReset: also clear out hostCPUModel
authorJán Tomko <jtomko@redhat.com>
Mon, 24 Oct 2016 15:35:32 +0000 (17:35 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 25 Oct 2016 11:54:58 +0000 (13:54 +0200)
After succesfully reading an outdated caps cache from disk,
calling virQEMUCapsReset did not properly clear out the calculated
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

index 9132469f06096b3924494e8a489eed6d999f6e22..130f1dba960267c9ade0cfb4ca0599da678166d1 100644 (file)
@@ -3430,6 +3430,9 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps)
 
     VIR_FREE(qemuCaps->gicCapabilities);
     qemuCaps->ngicCapabilities = 0;
+
+    virCPUDefFree(qemuCaps->hostCPUModel);
+    qemuCaps->hostCPUModel = NULL;
 }