diff --git a/src/ssb.c b/src/ssb.c index 9f9b48d8..64d5cd42 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -270,6 +270,11 @@ static void _tf_ssb_connection_on_tcp_alloc(uv_handle_t* handle, size_t suggeste static void _tf_ssb_connection_on_write(uv_write_t* req, int status) { + if (status) + { + tf_ssb_connection_t* connection = req->data; + _tf_ssb_connection_close(connection, "write failed asynchronously"); + } free(req); } @@ -282,6 +287,7 @@ static void _tf_ssb_write(tf_ssb_connection_t* connection, void* data, size_t si if (result) { _tf_ssb_connection_close(connection, "write failed"); + free(write); } }