cpu: Use g_auto* in virCPUCompareXML

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Tim Wiederhake 2020-09-07 16:58:55 +02:00 committed by Ján Tomko
parent e8d40cc3be
commit ca1c9716cc

View File

@ -111,21 +111,15 @@ virCPUCompareXML(virArch arch,
const char *xml,
bool failIncompatible)
{
virCPUDefPtr cpu = NULL;
virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
g_autoptr(virCPUDef) cpu = NULL;
VIR_DEBUG("arch=%s, host=%p, xml=%s",
virArchToString(arch), host, NULLSTR(xml));
if (virCPUDefParseXMLString(xml, VIR_CPU_TYPE_AUTO, &cpu) < 0)
goto cleanup;
return VIR_CPU_COMPARE_ERROR;
ret = virCPUCompare(arch, host, cpu, failIncompatible);
cleanup:
virCPUDefFree(cpu);
return ret;
return virCPUCompare(arch, host, cpu, failIncompatible);
}