forked from cory/tildefriends
Oops all leaks.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3918 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
474ff9cd74
commit
66ea0dadd0
@ -38,7 +38,7 @@ static void* _tf_realloc(int64_t* total, void* ptr, size_t size)
|
|||||||
{
|
{
|
||||||
memcpy(&old_size, old_ptr, sizeof(size_t));
|
memcpy(&old_size, old_ptr, sizeof(size_t));
|
||||||
}
|
}
|
||||||
void* new_ptr = realloc(old_ptr, size + sizeof(size_t));
|
void* new_ptr = realloc(old_ptr, size ? size + sizeof(size_t) : 0);
|
||||||
if (new_ptr)
|
if (new_ptr)
|
||||||
{
|
{
|
||||||
__atomic_add_fetch(total, (int64_t)size - (int64_t)old_size, __ATOMIC_RELAXED);
|
__atomic_add_fetch(total, (int64_t)size - (int64_t)old_size, __ATOMIC_RELAXED);
|
||||||
|
@ -167,7 +167,7 @@ socket_t* _socket_create_internal(JSContext* context)
|
|||||||
{
|
{
|
||||||
socket_t* socket = tf_malloc(sizeof(socket_t));
|
socket_t* socket = tf_malloc(sizeof(socket_t));
|
||||||
memset(socket, 0, sizeof(*socket));
|
memset(socket, 0, sizeof(*socket));
|
||||||
_sockets = realloc(_sockets, sizeof(socket_t*) * (_sockets_count + 1));
|
_sockets = tf_realloc(_sockets, sizeof(socket_t*) * (_sockets_count + 1));
|
||||||
_sockets[_sockets_count++] = socket;
|
_sockets[_sockets_count++] = socket;
|
||||||
|
|
||||||
socket->_closePromise = -1;
|
socket->_closePromise = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user