From 42d6d0e5013918382acabe6ded4c50886cd65667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 13 May 2026 10:03:37 +0400 Subject: [PATCH] ui/vt100: add vt100_fini() check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 8fa294482eb ("ui/console-vc: move VT100 state machine ...") Signed-off-by: Marc-André Lureau --- ui/vt100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vt100.c b/ui/vt100.c index f8140cfa85..6e64845b6c 100644 --- a/ui/vt100.c +++ b/ui/vt100.c @@ -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);