diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 11d54ade86ad79edf4e160e118b8f70dce081bb9..3d290fbe30834c945ad772c946dd10e35ed507b3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6731,12 +6731,13 @@ static virDomainObjPtr virDomainObjParseXML(virCapsPtr caps, char *str = virXMLPropString(nodes[i], "flag"); if (str) { int flag = virDomainTaintTypeFromString(str); - VIR_FREE(str); if (flag < 0) { virDomainReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown taint flag %s"), str); + VIR_FREE(str); goto error; } + VIR_FREE(str); virDomainObjTaint(obj, flag); } }