New Defects reported by Coverity Scan for libvirt
by scan-admin@coverity.com
Hi,
Please find the latest report on new defect(s) introduced to libvirt found with Coverity Scan.
4 new defect(s) introduced to libvirt found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)
** CID 314179: Memory - corruptions (USE_AFTER_FREE)
/src/qemu/qemu_monitor.c: 1921 in qemuMonitorGetCPUInfo()
________________________________________________________________________________________________________
*** CID 314179: Memory - corruptions (USE_AFTER_FREE)
/src/qemu/qemu_monitor.c: 1921 in qemuMonitorGetCPUInfo()
1915 if (!hotplugcpus ||
1916 qemuMonitorGetCPUInfoHotplug(hotplugcpus, nhotplugcpus,
1917 cpuentries, ncpuentries,
1918 info, maxvcpus) < 0) {
1919 /* Fallback to the legacy algorithm. Hotplug paths will make sure that
1920 * the appropriate data is present */
>>> CID 314179: Memory - corruptions (USE_AFTER_FREE)
>>> Calling "qemuMonitorCPUInfoClear" frees pointer "info->props" which has already been freed.
1921 qemuMonitorCPUInfoClear(info, maxvcpus);
1922 qemuMonitorGetCPUInfoLegacy(cpuentries, ncpuentries, info, maxvcpus);
1923 }
1924
1925 *vcpus = g_steal_pointer(&info);
1926 ret = 0;
** CID 314178: Memory - corruptions (USE_AFTER_FREE)
________________________________________________________________________________________________________
*** CID 314178: Memory - corruptions (USE_AFTER_FREE)
/src/security/security_dac.c: 1435 in virSecurityDACRestoreHostdevLabel()
1429
1430 if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
1431 g_autofree char *vfioGroupDev = virPCIDeviceGetIOMMUGroupDev(pci);
1432
1433 if (!vfioGroupDev) {
1434 virPCIDeviceFree(pci);
>>> CID 314178: Memory - corruptions (USE_AFTER_FREE)
>>> Calling "glib_autoptr_cleanup_virPCIDevice" frees pointer "pci" which has already been freed.
1435 return -1;
1436 }
1437 ret = virSecurityDACRestoreFileLabelInternal(mgr, NULL,
1438 vfioGroupDev, false);
1439 } else {
1440 ret = virPCIDeviceFileIterate(pci, virSecurityDACRestorePCILabel, mgr);
** CID 314177: Memory - corruptions (USE_AFTER_FREE)
________________________________________________________________________________________________________
*** CID 314177: Memory - corruptions (USE_AFTER_FREE)
/src/qemu/qemu_snapshot.c: 1578 in qemuSnapshotCreateActiveExternal()
1572 }
1573
1574 virQEMUSaveDataFree(data);
1575 if (memory_unlink && ret < 0)
1576 unlink(snapdef->file);
1577
>>> CID 314177: Memory - corruptions (USE_AFTER_FREE)
>>> Calling "g_autoptr_cleanup_generic_gfree" frees pointer "xml" which has already been freed.
1578 return ret;
1579 }
1580
1581
1582 virDomainSnapshotPtr
1583 qemuSnapshotCreateXML(virDomainPtr domain,
** CID 314176: Memory - corruptions (USE_AFTER_FREE)
________________________________________________________________________________________________________
*** CID 314176: Memory - corruptions (USE_AFTER_FREE)
/src/qemu/qemu_driver.c: 2887 in qemuDomainSaveInternal()
2881 if (ret == 0)
2882 qemuDomainRemoveInactiveJob(driver, vm);
2883
2884 cleanup:
2885 virQEMUSaveDataFree(data);
2886 virObjectEventStateQueue(driver->domainEventState, event);
>>> CID 314176: Memory - corruptions (USE_AFTER_FREE)
>>> Calling "g_autoptr_cleanup_generic_gfree" frees pointer "xml" which has already been freed.
2887 return ret;
2888 }
2889
2890
2891 static int
2892 qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml,
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my...