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.
This commit is contained in:
John Ferlan 2015-12-18 07:45:01 -05:00
parent 488222800e
commit dc77344a8e

View File

@ -930,7 +930,8 @@ storagePoolCreate(virStoragePoolPtr obj,
cleanup:
VIR_FREE(stateFile);
virStoragePoolObjUnlock(pool);
if (pool)
virStoragePoolObjUnlock(pool);
return ret;
}