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: 8fa294482eb ("ui/console-vc: move VT100 state machine ...") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
May 13, 2026 at 10:03 UTC
42d6d0e5013918382acabe6ded4c50886cd65667
1 file changed
+3
ui/vt100.c
+3
@@ -978,6 +978,9 @@ void vt100_init(QemuVT100 *vt,
978
979
void vt100_fini(QemuVT100 *vt)
980
{
981
+ if (!QTAILQ_IN_USE(vt, list)) {
982
+ return;
983
+ }
984
QTAILQ_REMOVE(&vt100s, vt, list);
985
fifo8_destroy(&vt->out_fifo);
986
g_free(vt->cells);