mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +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,
|
storagePoolLookupByTargetPathCallback,
|
||||||
cleanpath))) {
|
cleanpath))) {
|
||||||
def = virStoragePoolObjGetDef(obj);
|
def = virStoragePoolObjGetDef(obj);
|
||||||
if (virStoragePoolLookupByTargetPathEnsureACL(conn, def) < 0)
|
if (virStoragePoolLookupByTargetPathEnsureACL(conn, def) < 0) {
|
||||||
|
virStoragePoolObjEndAPI(&obj);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
pool = virGetStoragePool(conn, def->name, def->uuid, NULL, NULL);
|
pool = virGetStoragePool(conn, def->name, def->uuid, NULL, NULL);
|
||||||
virStoragePoolObjEndAPI(&obj);
|
virStoragePoolObjEndAPI(&obj);
|
||||||
|
Loading…
Reference in New Issue
Block a user