diff --git a/ui/vnc.c b/ui/vnc.c index 821acdd8b0..243e99bb95 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3786,10 +3786,6 @@ void vnc_display_open(const char *id, Error **errp) goto fail; } - if (saddr == NULL) { - return; - } - password = qemu_opt_get_bool(opts, "password", false); if (password) { if (fips_get_state()) { @@ -3974,6 +3970,10 @@ void vnc_display_open(const char *id, Error **errp) register_displaychangelistener(&vd->dcl); } + if (saddr == NULL) { + goto cleanup; + } + if (reverse) { if (vnc_display_connect(vd, saddr, nsaddr, wsaddr, nwsaddr, errp) < 0) { goto fail;