From: Ján Tomko Date: Thu, 4 Jul 2013 12:41:46 +0000 (+0200) Subject: Unlock the storage volume object after looking it up X-Git-Tag: CVE-2013-2230~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe89fd3b4071242ce9bbae6e1178fee30dc2f4f9;p=thirdparty%2Flibvirt.git Unlock the storage volume object after looking it up Introduced by c930410. https://bugzilla.redhat.com/show_bug.cgi?id=980676 --- diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 02f7b69893..d15b3d4868 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1380,15 +1380,16 @@ storageVolLookupByKey(virConnectPtr conn, virStorageVolDefFindByKey(driver->pools.objs[i], key); if (vol) { - if (virStorageVolLookupByKeyEnsureACL(conn, driver->pools.objs[i]->def, vol) < 0) + if (virStorageVolLookupByKeyEnsureACL(conn, driver->pools.objs[i]->def, vol) < 0) { + virStoragePoolObjUnlock(driver->pools.objs[i]); goto cleanup; + } ret = virGetStorageVol(conn, driver->pools.objs[i]->def->name, vol->name, vol->key, NULL, NULL); - goto cleanup; } } virStoragePoolObjUnlock(driver->pools.objs[i]); @@ -1440,15 +1441,16 @@ storageVolLookupByPath(virConnectPtr conn, VIR_FREE(stable_path); if (vol) { - if (virStorageVolLookupByPathEnsureACL(conn, driver->pools.objs[i]->def, vol) < 0) + if (virStorageVolLookupByPathEnsureACL(conn, driver->pools.objs[i]->def, vol) < 0) { + virStoragePoolObjUnlock(driver->pools.objs[i]); goto cleanup; + } ret = virGetStorageVol(conn, driver->pools.objs[i]->def->name, vol->name, vol->key, NULL, NULL); - goto cleanup; } } virStoragePoolObjUnlock(driver->pools.objs[i]);