From: Paolo Bonzini Date: Fri, 1 Oct 2021 17:04:03 +0000 (+0200) Subject: machine: Use g_autoptr in machine_set_smp X-Git-Tag: v6.2.0-rc0~75^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7f944bb94a375e8ee7469ffa535ea6e11ce59e1;p=thirdparty%2Fqemu.git machine: Use g_autoptr in machine_set_smp Signed-off-by: Paolo Bonzini --- diff --git a/hw/core/machine.c b/hw/core/machine.c index 54f04a5ac66..d49ebc24e29 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -897,7 +897,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name, { MachineClass *mc = MACHINE_GET_CLASS(obj); MachineState *ms = MACHINE(obj); - SMPConfiguration *config; + g_autoptr(SMPConfiguration) config = NULL; ERRP_GUARD(); if (!visit_type_SMPConfiguration(v, name, &config, errp)) { @@ -920,7 +920,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name, smp_parse(ms, config, errp); if (*errp) { - goto out_free; + return; } /* sanity-check smp_cpus and max_cpus against mc */ @@ -935,9 +935,6 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name, ms->smp.max_cpus, mc->name, mc->max_cpus); } - -out_free: - qapi_free_SMPConfiguration(config); } static void machine_class_init(ObjectClass *oc, void *data)