]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Check error from virXMLFormatElement call
authorJohn Ferlan <jferlan@redhat.com>
Fri, 8 Jun 2018 17:07:55 +0000 (13:07 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 11 Jun 2018 22:33:13 +0000 (18:33 -0400)
Commit id 1bd5a08d added a call to virXMLFormatElement without
also checking the return status.

Found by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Katerina Koukiou <kkoukiou@redhat.com>
src/conf/domain_conf.c

index ab93bb7b45888b1d26b0bdc4244f07f6a5768ba3..1157c7dd9305ec1f79eeeef4e9e85a373f28d55e 100644 (file)
@@ -27522,7 +27522,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
                                           unit, short_size);
                     }
 
-                    virXMLFormatElement(buf, "smm", &attrBuf, &childBuf);
+                    if (virXMLFormatElement(buf, "smm", &attrBuf, &childBuf) < 0)
+                        goto error;
                 }
 
                 break;