virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host;
virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev;
- virPCIDevicePtr pci = NULL;
- virUSBDevicePtr usb = NULL;
- virSCSIDevicePtr scsi = NULL;
- virSCSIVHostDevicePtr host = NULL;
- char *tmpPath = NULL;
+ g_autoptr(virPCIDevice) pci = NULL;
+ g_autoptr(virUSBDevice) usb = NULL;
+ g_autoptr(virSCSIDevice) scsi = NULL;
+ g_autoptr(virSCSIVHostDevice) host = NULL;
+ g_autofree char *tmpPath = NULL;
bool includeVFIO = false;
char **tmpPaths = NULL;
- int *tmpPerms = NULL;
+ g_autofree int *tmpPerms = NULL;
size_t tmpNpaths = 0;
int perm = 0;
ret = 0;
cleanup:
virStringListFreeCount(tmpPaths, tmpNpaths);
- VIR_FREE(tmpPerms);
- virPCIDeviceFree(pci);
- virUSBDeviceFree(usb);
- virSCSIDeviceFree(scsi);
- virSCSIVHostDeviceFree(host);
- VIR_FREE(tmpPath);
return ret;
}