
16 Apr
2021
16 Apr
'21
4:31 a.m.
On Thu, Apr 15, 2021 at 17:08:28 +0200, Tim Wiederhake wrote:
virQEMUCapsSetHostModel is called by virQEMUCapsInitHostCPUModel, which in turn is typically called twice (for KVM and QEMU), e.g. in virQEMUCapsLoadCache and virQEMUCapsNewForBinaryInternal.
The second call leaks memory pointed to by "reported", "migratable" and "full".
That sounds to me like a usage problem in the caller, where if it's called twice it's either using a non-cleared variable, or the value will be overwritten and thus calling it in the first place is probably dubious, so the proposed patch feels to me like it's fixing a symptom rather than the real problem.