summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-12-07 12:57:06 +0200
committerAlon Levy <alevy@redhat.com>2010-12-07 21:32:34 +0200
commit380b5e9dd70edc79d13fe07210fc7ff2c004e842 (patch)
treec1cb67f8a73a3273f98cb8337eef2b8c78a78e4c /server
parentec0b90db7fc4e0e27130d0b1bec662ffd7b2ce56 (diff)
downloadspice-380b5e9dd70edc79d13fe07210fc7ff2c004e842.tar.gz
spice-380b5e9dd70edc79d13fe07210fc7ff2c004e842.tar.xz
spice-380b5e9dd70edc79d13fe07210fc7ff2c004e842.zip
server/red_channel: error channel if alloc_msg_buf fails (returns NULL)
Diffstat (limited to 'server')
-rw-r--r--server/red_channel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index cab56a0d..3c1aedeb 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -92,6 +92,11 @@ static void red_peer_handle_incoming(RedsStreamContext *peer, IncomingHandler *h
if (handler->msg_pos < handler->header.size) {
if (!handler->msg) {
handler->msg = handler->alloc_msg_buf(handler->opaque, &handler->header);
+ if (handler->msg == NULL) {
+ red_printf("ERROR: channel refused to allocate buffer.");
+ handler->on_error(handler->opaque);
+ return;
+ }
}
bytes_read = red_peer_receive(peer,