From dc77344a8e47ff8e7cc31734fa39bc6ab3bc1572 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Fri, 18 Dec 2015 07:45:01 -0500 Subject: [PATCH] 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. --- src/storage/storage_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }