提交 d659cd34 编写于 作者: M Michal Privoznik

virsysinfo: Don't leak fw_cfg

In v6.4.0-72-g3dda889a 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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 1b22dd6d
...@@ -131,6 +131,19 @@ void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def) ...@@ -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) ...@@ -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);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册