mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
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:
parent
eda5f575f2
commit
118fcdd480
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user