summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-05-31 09:49:47 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-05-31 09:58:02 +0300
commit858a1aaa34aa0a27fa31370e96927d8216c1c638 (patch)
treea7b629e5b8c81a61a54cd156b835fef029eec35a
parent2d2121a17038bc02c83f247a43c16d9580959e04 (diff)
downloadspice-858a1aaa34aa0a27fa31370e96927d8216c1c638.tar.gz
spice-858a1aaa34aa0a27fa31370e96927d8216c1c638.tar.xz
spice-858a1aaa34aa0a27fa31370e96927d8216c1c638.zip
server/red_channel: do not attempt to write if the channel client is disconnected
The red_channel_client_event call to red_channel_client_receive might result in a disconnected channel client. The following call to red_channel_client_push may call to red_peer_handle_outgoing with a disconnected socket.
-rw-r--r--server/red_channel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index de500473..9a48e775 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -305,6 +305,10 @@ static void red_peer_handle_outgoing(RedsStream *stream, OutgoingHandler *handle
{
ssize_t n;
+ if (!stream) {
+ return;
+ }
+
if (handler->size == 0) {
handler->vec = handler->vec_buf;
handler->size = handler->cb->get_msg_size(handler->opaque);