From: John Ferlan Date: Tue, 6 May 2014 18:16:48 +0000 (-0400) Subject: storage: Resolve issues in failure path X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e1e4483c90442a2125cbf94dc28bf61eab0b1485;p=libvirt.git storage: Resolve issues in failure path https://bugzilla.redhat.com/show_bug.cgi?id=1092882 Refactoring in commit id '0c2305b3' resulted in the wrong storage volume object being passed to the new storageVolDeleteInternal(). It should have passed 'voldef' which is the address found in the pool->volumes.objs[i] array. By passing 'voldef', the DeleteInternal code will find and remove the voldef from the volumes.objs[] list. --- diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 542b3827a4..67494a3aef 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1766,12 +1766,11 @@ storageVolCreateXML(virStoragePoolPtr obj, voldef->building = 0; pool->asyncjobs--; - voldef = NULL; - if (buildret < 0) { - storageVolDeleteInternal(volobj, backend, pool, buildvoldef, + VIR_FREE(buildvoldef); + storageVolDeleteInternal(volobj, backend, pool, voldef, 0, false); - buildvoldef = NULL; + voldef = NULL; goto cleanup; }