mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
cpu_map: Use g_auto* in loadIncludes
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
fc8e0cad0c
commit
ffa6dc0519
@ -125,18 +125,16 @@ loadIncludes(xmlXPathContextPtr ctxt,
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
char *filename = virXMLPropString(nodes[i], "filename");
|
||||
g_autofree char *filename = virXMLPropString(nodes[i], "filename");
|
||||
|
||||
if (!filename) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Missing 'filename' in CPU map include"));
|
||||
return -1;
|
||||
}
|
||||
VIR_DEBUG("Finding CPU map include '%s'", filename);
|
||||
if (cpuMapLoadInclude(filename, vendorCB, featureCB, modelCB, data) < 0) {
|
||||
VIR_FREE(filename);
|
||||
if (cpuMapLoadInclude(filename, vendorCB, featureCB, modelCB, data) < 0)
|
||||
return -1;
|
||||
}
|
||||
VIR_FREE(filename);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user