]> xenbits.xensource.com Git - libvirt.git/commitdiff
cpu: fix cleanup when signature parsing fails
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 16 Aug 2018 10:28:54 +0000 (11:28 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 28 Aug 2018 11:08:21 +0000 (12:08 +0100)
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>
src/cpu/cpu_x86.c

index 7fa84f6014c92c0f675c08d9c6239604f8fc4e85..f48a7616d4450aa1940fb0ddd29e18b8bf9bb187 100644 (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);