diff --git a/src/ssb.c b/src/ssb.c index da47e6bc..cdd5f63a 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -579,6 +579,11 @@ static void _tf_ssb_connection_box_stream_send(tf_ssb_connection_t* connection, { size_t send_size = size - offset > k_send_max ? k_send_max : size - offset; uint8_t* message_enc = tf_malloc(send_size + 34); + if (!message_enc) + { + tf_ssb_connection_close(connection, "out of memory"); + return; + } uint8_t nonce1[crypto_secretbox_NONCEBYTES]; memcpy(nonce1, connection->send_nonce, sizeof(nonce1));