diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f517646c55..a6407f074b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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; }