malloc and leak fix.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3821 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2022-02-05 19:58:22 +00:00
parent 059024452c
commit ef9e42e030
2 changed files with 3 additions and 4 deletions

View File

@ -2198,10 +2198,8 @@ void tf_ssb_connect_str(tf_ssb_t* ssb, const char* address)
static void _tf_ssb_on_broadcast_listener_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf)
{
tf_ssb_connection_t* connection = handle->data;
size_t malloc_size = sizeof(connection->recv_buffer) - connection->recv_size;
buf->base = malloc_size ? malloc(malloc_size) : NULL;
buf->len = malloc_size;
buf->base = malloc(suggested_size);
buf->len = suggested_size;
}
static void _tf_ssb_notify_broadcasts_changed(tf_ssb_t* ssb)

View File

@ -789,6 +789,7 @@ void tf_task_on_receive_packet(int packetType, const char* begin, size_t length,
{
_tf_task_sendPromiseResolve(to, from, promise, result);
}
JS_FreeValue(to->_context, result);
}
break;
case kResolvePromise: