5276ec7 testUpdateQEMUCaps: Don't leak host cpuData

Authored and Committed by mprivozn 5 years ago
    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: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
    
        
file modified
+19 -2
file modified
+4 -0
file modified
+3 -0