]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: consistently check for error when calling virSysinfoFormat()
authorLaine Stump <laine@redhat.com>
Sat, 4 Jul 2020 21:55:59 +0000 (17:55 -0400)
committerLaine Stump <laine@redhat.com>
Wed, 8 Jul 2020 20:35:00 +0000 (16:35 -0400)
Every other caller of this function checks for an error return and
ends their formatting early if there is an error. This function
happily continues on its way.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c

index 37d4ccf9557e20b01ced3ca3708d9b2a51d864ab..3a110b330f1e1a2b569454720042f20db89d7480 100644 (file)
@@ -29581,8 +29581,10 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
     if (def->resource)
         virDomainResourceDefFormat(buf, def->resource);
 
-    for (i = 0; i < def->nsysinfo; i++)
-        virSysinfoFormat(buf, def->sysinfo[i]);
+    for (i = 0; i < def->nsysinfo; i++) {
+        if (virSysinfoFormat(buf, def->sysinfo[i]) < 0)
+            goto error;
+    }
 
     if (def->os.bootloader) {
         virBufferEscapeString(buf, "<bootloader>%s</bootloader>\n",