From: John Ferlan Date: Fri, 8 Jun 2018 17:07:55 +0000 (-0400) Subject: conf: Check error from virXMLFormatElement call X-Git-Tag: v4.5.0-rc1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1aaa253d2c03d52bf2ad7c815e992721bf49ab2;p=thirdparty%2Flibvirt.git conf: Check error from virXMLFormatElement call Commit id 1bd5a08d added a call to virXMLFormatElement without also checking the return status. Found by Coverity. Signed-off-by: John Ferlan Reviewed-by: Katerina Koukiou --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ab93bb7b45..1157c7dd93 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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;