cpu: fix cleanup when signature parsing fails

Two pieces of code accidentally jumped to the wrong label when they
failed causing incorrect cleanup, returning a partially initialized
CPU model struct.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-08-16 11:28:54 +01:00
parent eda5f575f2
commit 118fcdd480

View File

@ -1251,7 +1251,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid CPU signature family in model %s"),
model->name);
goto cleanup;
goto error;
}
rc = virXPathUInt("string(./signature/@model)", ctxt, &sigModel);
@ -1259,7 +1259,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid CPU signature model in model %s"),
model->name);
goto cleanup;
goto error;
}
model->signature = x86MakeSignature(sigFamily, sigModel, 0);