mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
domain_conf.c: use g_autofree in 'dev' in virDomainDefParseBootXML()
This spares us of 2 explicit VIR_FREE() calls. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
bac69aa1f9
commit
340db6e549
@ -18907,7 +18907,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"));
|
||||
@ -18917,10 +18917,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user