This spares us of 2 explicit VIR_FREE() calls. Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx> --- src/conf/domain_conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5e5905f483..4229add26d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18908,7 +18908,7 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt, for (i = 0; i < n && i < VIR_DOMAIN_BOOT_LAST; i++) { int val; - char *dev = virXMLPropString(nodes[i], "dev"); + g_autofree char *dev = virXMLPropString(nodes[i], "dev"); if (!dev) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing boot device")); @@ -18918,10 +18918,8 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown boot device '%s'"), dev); - VIR_FREE(dev); return -1; } - VIR_FREE(dev); def->os.bootDevs[def->os.nBootDevs++] = val; } -- 2.26.2