From 118fcdd480ad38a3e8477f466f6a876dce7e9fa6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Thu, 16 Aug 2018 11:28:54 +0100 Subject: [PATCH] cpu: fix cleanup when signature parsing fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Daniel P. Berrangé --- src/cpu/cpu_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 7fa84f6014..f48a7616d4 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -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); -- 2.39.5