virQEMUCapsReset: also clear out hostCPUModel

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.
This commit is contained in:
Ján Tomko 2016-10-24 17:35:32 +02:00
parent f830674bf3
commit 1157678f81

View File

@ -3430,6 +3430,9 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps)
VIR_FREE(qemuCaps->gicCapabilities);
qemuCaps->ngicCapabilities = 0;
virCPUDefFree(qemuCaps->hostCPUModel);
qemuCaps->hostCPUModel = NULL;
}