On Fri, Feb 08, 2019 at 01:37:03PM -0500, John Ferlan wrote:
Let's make use of the auto __cleanup capabilities cleaning up any
now unnecessary goto paths.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
Reviewed-by: Erik Skultety <eskultet(a)redhat.com>
---
src/conf/domain_conf.c | 3 +--
src/conf/storage_conf.c | 3 +--
src/conf/storage_conf.h | 1 +
src/conf/virstorageobj.c | 27 +++++++++++----------------
src/phyp/phyp_driver.c | 3 +--
src/storage/storage_driver.c | 6 ++----
src/test/test_driver.c | 6 ++----
tests/storagebackendsheepdogtest.c | 6 ++----
tests/storagepoolxml2xmltest.c | 3 +--
tests/storagevolxml2argvtest.c | 3 +--
tests/storagevolxml2xmltest.c | 3 +--
11 files changed, 24 insertions(+), 40 deletions(-)
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index cac5642afd..dc082b1d08 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -1952,11 +1952,11 @@ phypStorageVolCreateXML(virStoragePoolPtr pool,
{
virCheckFlags(0, NULL);
- virStoragePoolDefPtr spdef = NULL;
virStorageVolPtr vol = NULL;
virStorageVolPtr dup_vol = NULL;
char *key = NULL;
VIR_AUTOPTR(virStorageVolDef) voldef = NULL;
+ VIR_AUTOPTR(virStoragePoolDef) spdef = NULL;
if (VIR_ALLOC(spdef) < 0)
return NULL;
@@ -2036,7 +2036,6 @@ phypStorageVolCreateXML(virStoragePoolPtr pool,
err:
VIR_FREE(key);
- virStoragePoolDefFree(spdef);
It seems spdef was leaked on success in this function before this patch.
virObjectUnref(vol);
return NULL;
}
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano