ui/vt100: add vt100_fini() check

vt100_fini() is called unconditonally from qemu_text_console_finalize(),
but it may not have been vt100_init()/opened: fix the crash in that case.

Fixes: 8fa294482e ("ui/console-vc: move VT100 state machine ...")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2026-05-13 10:03:37 +04:00
parent c862a1e7e2
commit 42d6d0e501

View File

@@ -978,6 +978,9 @@ void vt100_init(QemuVT100 *vt,
void vt100_fini(QemuVT100 *vt)
{
if (!QTAILQ_IN_USE(vt, list)) {
return;
}
QTAILQ_REMOVE(&vt100s, vt, list);
fifo8_destroy(&vt->out_fifo);
g_free(vt->cells);