mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 09:46:50 +00:00
server/red_channel: error channel if alloc_msg_buf fails (returns NULL)
This commit is contained in:
parent
ec0b90db7f
commit
380b5e9dd7
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user