mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemuDomainDiskPrivateDispose: Prevent dangling 'disk' pointer in blockjob data
Clear the 'disk' member of 'blockjob' as we're freeing the disk object at this point. While this should not normally happen it was observed when other bug allowed the VM to be cleared while other threads didn't yet finish. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
737f897c29
commit
b4423a753b
@ -798,7 +798,13 @@ qemuDomainDiskPrivateDispose(void *obj)
|
||||
virObjectUnref(priv->migrSource);
|
||||
g_free(priv->qomName);
|
||||
g_free(priv->nodeCopyOnRead);
|
||||
virObjectUnref(priv->blockjob);
|
||||
if (priv->blockjob) {
|
||||
/* Prevent dangling 'disk' pointer, as the disk object will be freed
|
||||
* right after this function returns if any of the blockjob instance
|
||||
* outlives this for any reason. */
|
||||
priv->blockjob->disk = NULL;
|
||||
virObjectUnref(priv->blockjob);
|
||||
}
|
||||
}
|
||||
|
||||
static virClass *qemuDomainStorageSourcePrivateClass;
|
||||
|
Loading…
Reference in New Issue
Block a user