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>
return NULL;
}
- if (removeCompat)
+ if (removeCompat) {
+ virDomainChrDefFree(vmdef->consoles[0]);
VIR_DELETE_ELEMENT(vmdef->consoles, 0, vmdef->nconsoles);
+ }
return ret;
}