mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-03 18:35:19 +00:00
domain_conf: fix crash in virDomainObjListFindByUUIDInternal
If a domain object is being removed and looked up concurrently we must ensure we unlock the object before unreferencing it, since the latter might free the object. The flaw was introduced in commit feb1a4d792e1c35b1009e69c00bf351b39. Signed-off-by: Michael Chapman <mike@very.puzzling.org> (cherry picked from commit 616003d6bd5a3d87d6d529ddb6d83715979d903c)
This commit is contained in:
parent
2206ec869b
commit
3db520d9db
@ -1068,9 +1068,9 @@ virDomainObjListFindByUUIDInternal(virDomainObjListPtr doms,
|
||||
if (obj) {
|
||||
virObjectLock(obj);
|
||||
if (obj->removing) {
|
||||
virObjectUnlock(obj);
|
||||
if (ref)
|
||||
virObjectUnref(obj);
|
||||
virObjectUnlock(obj);
|
||||
obj = NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user