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; }