mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemuDomainChrRemove: Don't leak vmdef->consoles[0]
When removing the compat console from domain defintion, removing it from the vmdef->consoles array is good, but not sufficient. The console definition might have been fully allocated (after daemon restarted and reloaded the status XML). Use virDomainChrDefFree() to free also the definition. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9129643d26
commit
e99072731c
@ -1937,8 +1937,10 @@ qemuDomainChrRemove(virDomainDef *vmdef,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (removeCompat)
|
||||
if (removeCompat) {
|
||||
virDomainChrDefFree(vmdef->consoles[0]);
|
||||
VIR_DELETE_ELEMENT(vmdef->consoles, 0, vmdef->nconsoles);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user