This is the only instance of g_autofree change applicable for qemu_checkpoint.c Signed-off-by: Seeteena Thoufeek <s1seetee@xxxxxxxxxxxxxxxxxx> --- src/qemu/qemu_checkpoint.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 3a510c9..ccd10cb 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -405,9 +405,8 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainCheckpointDefPtr def) { - int ret = -1; size_t i; - char *xml = NULL; + g_autofree char *xml = NULL; qemuDomainObjPrivatePtr priv = vm->privateData; /* Easiest way to clone inactive portion of vm->def is via @@ -419,10 +418,10 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver, priv->qemuCaps, VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) - goto cleanup; + return -1; if (virDomainCheckpointAlignDisks(def) < 0) - goto cleanup; + return -1; for (i = 0; i < def->ndisks; i++) { virDomainCheckpointDiskDefPtr disk = &def->disks[i]; @@ -434,7 +433,7 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("bitmap for disk '%s' must match checkpoint name '%s'"), disk->name, def->parent.name); - goto cleanup; + return -1; } if (vm->def->disks[i]->src->format != VIR_STORAGE_FILE_QCOW2) { @@ -444,15 +443,11 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver, disk->name, virStorageFileFormatTypeToString( vm->def->disks[i]->src->format)); - goto cleanup; + return -1; } } - ret = 0; - - cleanup: - VIR_FREE(xml); - return ret; + return 0; } static int -- 1.8.3.1