diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index 67c7b4af17feed4103c195e6e4bbd0b40a9dabf4..03f68c359db1294c3575a988fa2f3290dd448e2c 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -33,7 +33,7 @@ SArray* taosArrayInit(size_t size, size_t elemSize) { } pArray->size = 0; - pArray->pData = taosMemoryMalloc(size, elemSize); + pArray->pData = taosMemoryMalloc(size * elemSize); if (pArray->pData == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; taosMemoryFree(pArray);