diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index c2ff4b8d06..6aa10d89f6 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -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);