mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 16:15:19 +00:00
conf: Clear pointer to freed bitmap holding hostdev's 'origstates'
'virDomainHostdevDefClear' must clear the pointers too as it can be invoked multiple times on the same object e.g. inside qemuDomainRemoveHostDevice once via virDomainHostdevDefFree which skips freeing the object if it's used via <interface> and thus has a 'net' definition corresponding to it, and then subsequently via virDomainNetDefFree. Fix it by clearing the pointer along with freeing it. Fixes: d9e4075d4e9 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2182961 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2c6b5a8425
commit
0bfd11dd85
@ -3384,7 +3384,7 @@ void virDomainHostdevDefClear(virDomainHostdevDef *def)
|
||||
VIR_FREE(def->source.subsys.u.scsi_host.wwpn);
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
virBitmapFree(def->source.subsys.u.pci.origstates);
|
||||
g_clear_pointer(&def->source.subsys.u.pci.origstates, virBitmapFree);
|
||||
break;
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||
|
Loading…
x
Reference in New Issue
Block a user