mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
Do not crash if channel clients cannot be created
Channel client creation can fail in some situation. For instance if during a migration the client is disconnected. In most cases this is ignored (this is usually logged in red_channel_client_initable_init) but not in case of CursorChannelClient and StreamChannelClient. This fixes rhbz#1788757. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Julien Rope <jrope@redhat.com>
This commit is contained in:
parent
7026f12c1b
commit
1ce119009a
@ -348,7 +348,9 @@ cursor_channel_connect(CursorChannel *cursor, RedClient *client, RedStream *stre
|
||||
ccc = cursor_channel_client_new(cursor, client, stream,
|
||||
migrate,
|
||||
caps);
|
||||
spice_return_if_fail(ccc != NULL);
|
||||
if (ccc == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
RedChannelClient *rcc = RED_CHANNEL_CLIENT(ccc);
|
||||
red_channel_client_ack_zero_messages_window(rcc);
|
||||
|
||||
@ -441,7 +441,9 @@ stream_channel_connect(RedChannel *red_channel, RedClient *red_client, RedStream
|
||||
spice_return_if_fail(stream != NULL);
|
||||
|
||||
client = stream_channel_client_new(channel, red_client, stream, migration, caps);
|
||||
spice_return_if_fail(client != NULL);
|
||||
if (client == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// request new stream
|
||||
start->num_codecs = stream_channel_get_supported_codecs(channel, start->codecs);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user