mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
storage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath
'virStoragePoolObjListSearch' returns a locked and refed object, thus we must release it on ACL permission failure. Fixes: 7aa0e8c0cb8 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
af013aa14c
commit
447f69dec4
@ -1738,8 +1738,10 @@ storagePoolLookupByTargetPath(virConnectPtr conn,
|
||||
storagePoolLookupByTargetPathCallback,
|
||||
cleanpath))) {
|
||||
def = virStoragePoolObjGetDef(obj);
|
||||
if (virStoragePoolLookupByTargetPathEnsureACL(conn, def) < 0)
|
||||
if (virStoragePoolLookupByTargetPathEnsureACL(conn, def) < 0) {
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pool = virGetStoragePool(conn, def->name, def->uuid, NULL, NULL);
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
|
Loading…
x
Reference in New Issue
Block a user