mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +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++) {
|
for (i = 0; i < n && i < VIR_DOMAIN_BOOT_LAST; i++) {
|
||||||
int val;
|
int val;
|
||||||
char *dev = virXMLPropString(nodes[i], "dev");
|
g_autofree char *dev = virXMLPropString(nodes[i], "dev");
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("missing boot device"));
|
"%s", _("missing boot device"));
|
||||||
@ -18917,10 +18917,8 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
|
|||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("unknown boot device '%s'"),
|
_("unknown boot device '%s'"),
|
||||||
dev);
|
dev);
|
||||||
VIR_FREE(dev);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
VIR_FREE(dev);
|
|
||||||
def->os.bootDevs[def->os.nBootDevs++] = val;
|
def->os.bootDevs[def->os.nBootDevs++] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user