Commit id '
1b5685da' refactored the code to move buildvoldef inside
the buildVol conditional; however, the VIR_FREE of the memory was
left only when 'buildret' failed, thus we're leaking memory.
Signed-off-by: John Ferlan <jferlan@redhat.com>
buildret = backend->buildVol(obj->conn, pool, buildvoldef, flags);
+ VIR_FREE(buildvoldef);
+
storageDriverLock();
virStoragePoolObjLock(pool);
storageDriverUnlock();
pool->asyncjobs--;
if (buildret < 0) {
- VIR_FREE(buildvoldef);
storageVolDeleteInternal(volobj, backend, pool, voldef,
0, false);
voldef = NULL;