]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Clean up error path for create buildPool failure
authorJohn Ferlan <jferlan@redhat.com>
Fri, 18 Dec 2015 12:45:01 +0000 (07:45 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 5 Jan 2016 14:08:02 +0000 (09:08 -0500)
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

index c8f259e317348284d2b0c1556d362dc875c5dd64..ed5395be9cbc68634f92510bce6c9863810c25a3 100644 (file)
@@ -930,7 +930,8 @@ storagePoolCreate(virStoragePoolPtr obj,
 
  cleanup:
     VIR_FREE(stateFile);
-    virStoragePoolObjUnlock(pool);
+    if (pool)
+        virStoragePoolObjUnlock(pool);
     return ret;
 }