mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-03 20:01:16 +00:00
cpu_map: Use g_auto* in loadData
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
43250af8dd
commit
fc8e0cad0c
@ -55,8 +55,9 @@ loadData(const char *mapfile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
char *name = virXMLPropString(nodes[i], "name");
|
g_autofree char *name = NULL;
|
||||||
if (!name) {
|
|
||||||
|
if (!(name = virXMLPropString(nodes[i], "name"))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find %s name in CPU map '%s'"), element, mapfile);
|
_("cannot find %s name in CPU map '%s'"), element, mapfile);
|
||||||
return -1;
|
return -1;
|
||||||
@ -64,7 +65,6 @@ loadData(const char *mapfile,
|
|||||||
VIR_DEBUG("Load %s name %s", element, name);
|
VIR_DEBUG("Load %s name %s", element, name);
|
||||||
ctxt->node = nodes[i];
|
ctxt->node = nodes[i];
|
||||||
rv = callback(ctxt, name, data);
|
rv = callback(ctxt, name, data);
|
||||||
VIR_FREE(name);
|
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user