mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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 feb1a4d792.
Signed-off-by: Michael Chapman <mike@very.puzzling.org>
This commit is contained in:
committed by
Peter Krempa
parent
a6ec4f472d
commit
616003d6bd
@@ -1068,9 +1068,9 @@ virDomainObjListFindByUUIDInternal(virDomainObjListPtr doms,
|
||||
if (obj) {
|
||||
virObjectLock(obj);
|
||||
if (obj->removing) {
|
||||
virObjectUnlock(obj);
|
||||
if (ref)
|
||||
virObjectUnref(obj);
|
||||
virObjectUnlock(obj);
|
||||
obj = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user