diff --git a/qemu-char.c b/qemu-char.c index fb456cec34..48a45ef583 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3132,6 +3132,7 @@ static void tcp_chr_tls_init(CharDriverState *chr) if (tioc == NULL) { error_free(err); tcp_chr_disconnect(chr); + return; } object_unref(OBJECT(s->ioc)); s->ioc = QIO_CHANNEL(tioc);