mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
virDomainDefFree: Don't leak initenv name and value
When parsing boot options from domain XML in virDomainDefParseBootOptions() initenv id stored to: def->os.initenv[i]->name def->os.initenv[i]->value But these are never freed. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
addcebc7d0
commit
5619c93ce7
@ -2931,8 +2931,11 @@ void virDomainDefFree(virDomainDefPtr def)
|
||||
for (i = 0; def->os.initargv && def->os.initargv[i]; i++)
|
||||
VIR_FREE(def->os.initargv[i]);
|
||||
VIR_FREE(def->os.initargv);
|
||||
for (i = 0; def->os.initenv && def->os.initenv[i]; i++)
|
||||
for (i = 0; def->os.initenv && def->os.initenv[i]; i++) {
|
||||
VIR_FREE(def->os.initenv[i]->name);
|
||||
VIR_FREE(def->os.initenv[i]->value);
|
||||
VIR_FREE(def->os.initenv[i]);
|
||||
}
|
||||
VIR_FREE(def->os.initdir);
|
||||
VIR_FREE(def->os.inituser);
|
||||
VIR_FREE(def->os.initgroup);
|
||||
|
Loading…
x
Reference in New Issue
Block a user