mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
virsysinfo: Don't leak fw_cfg
In v6.4.0-72-g3dda889a44 I've introduced parsing and formatting of new sysinfo type 'fwcfg'. However, I've forgot to introduce code that would free parsed data. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
1b22dd6dd4
commit
d659cd341f
@ -131,6 +131,19 @@ void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def)
|
|||||||
VIR_FREE(def);
|
VIR_FREE(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
virSysinfoFWCfgDefClear(virSysinfoFWCfgDefPtr def)
|
||||||
|
{
|
||||||
|
if (!def)
|
||||||
|
return;
|
||||||
|
|
||||||
|
VIR_FREE(def->name);
|
||||||
|
VIR_FREE(def->value);
|
||||||
|
VIR_FREE(def->file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virSysinfoDefFree:
|
* virSysinfoDefFree:
|
||||||
* @def: a sysinfo structure
|
* @def: a sysinfo structure
|
||||||
@ -184,6 +197,10 @@ void virSysinfoDefFree(virSysinfoDefPtr def)
|
|||||||
|
|
||||||
virSysinfoOEMStringsDefFree(def->oemStrings);
|
virSysinfoOEMStringsDefFree(def->oemStrings);
|
||||||
|
|
||||||
|
for (i = 0; i < def->nfw_cfgs; i++)
|
||||||
|
virSysinfoFWCfgDefClear(&def->fw_cfgs[i]);
|
||||||
|
VIR_FREE(def->fw_cfgs);
|
||||||
|
|
||||||
VIR_FREE(def);
|
VIR_FREE(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user