testUpdateQEMUCaps: Don't leak host cpuData
When preparing qemuCaps for test cases the following is happening: qemuTestParseCapabilitiesArch() is called, which calls virQEMUCapsLoadCache() which in turn calls virQEMUCapsInitHostCPUModel() which sets qemuCaps->kvmCPU and qemuCaps->tcgCPU. But then the code tries to update the capabilities: testCompareXMLToArgv() calls testUpdateQEMUCaps() which calls virQEMUCapsInitHostCPUModel() again overwriting previously allocated memory. The solution is to free host cpuData in testUpdateQEMUCaps(). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
Showing
想要评论请 注册 或 登录