mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user