aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/nifs/common/socket_tarray.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/nifs/common/socket_tarray.c')
-rw-r--r--erts/emulator/nifs/common/socket_tarray.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/nifs/common/socket_tarray.c b/erts/emulator/nifs/common/socket_tarray.c
index bf37e5bc0e..a327e014c4 100644
--- a/erts/emulator/nifs/common/socket_tarray.c
+++ b/erts/emulator/nifs/common/socket_tarray.c
@@ -63,13 +63,13 @@ void* esock_tarray_create(uint32_t sz)
{
SocketTArrayInt* tarrayP;
- ESOCK_ASSERT( (sz == 0) );
+ ESOCK_ASSERT( (sz > 0) );
tarrayP = MALLOC(sizeof(SocketTArrayInt));
- ESOCK_ASSERT( (tarrayP == NULL) );
+ ESOCK_ASSERT( (tarrayP != NULL) );
tarrayP->array = MALLOC(sz * sizeof(ERL_NIF_TERM));
- ESOCK_ASSERT( (tarrayP->array == NULL) );
+ ESOCK_ASSERT( (tarrayP->array != NULL) );
tarrayP->sz = sz;
tarrayP->idx = 0;
@@ -131,7 +131,7 @@ void esock_tarray_ensure_fits(SocketTArrayInt* taP, uint32_t needs)
uint32_t newSz = (needs < taP->sz) ? 2*taP->sz : 2*needs;
void* mem = REALLOC(taP->array, newSz * sizeof(ERL_NIF_TERM));
- ESOCK_ASSERT( (mem == NULL) );
+ ESOCK_ASSERT( (mem != NULL) );
taP->sz = newSz;
taP->array = (ERL_NIF_TERM*) mem;