From: John Ferlan Date: Fri, 18 Dec 2015 12:45:01 +0000 (-0500) Subject: storage: Clean up error path for create buildPool failure X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dc77344a8e47ff8e7cc31734fa39bc6ab3bc1572;p=libvirt.git storage: Clean up error path for create buildPool failure Commit id 'aeb1078ab' added a buildPool option and failure path which calls virStoragePoolObjRemove, which unlocks the pool, clears the 'pool' variable, and goto cleanup. However, at cleanup virStoragePoolObjUnlock is called without check if pool is non NULL. --- diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index c8f259e317..ed5395be9c 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -930,7 +930,8 @@ storagePoolCreate(virStoragePoolPtr obj, cleanup: VIR_FREE(stateFile); - virStoragePoolObjUnlock(pool); + if (pool) + virStoragePoolObjUnlock(pool); return ret; }