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>2011-07-21 15:08:32 +0300
commitae7659fea94717741b7cccdd5718b1fff2804a9d (patch)
treed640fb5d73c2c278a2b5f75859b5387452edf89a /server
parentce516b0bdf036761daa9a248df1194182eb2428d (diff)
downloadspice-ae7659fea94717741b7cccdd5718b1fff2804a9d.tar.gz
spice-ae7659fea94717741b7cccdd5718b1fff2804a9d.tar.xz
spice-ae7659fea94717741b7cccdd5718b1fff2804a9d.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 f547f5ac..39413382 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -89,6 +89,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,