mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +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: 7aa0e8c0cb
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…
Reference in New Issue
Block a user