diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index 9bcada27cbe0c54c18ebf6ab90e04de7ccb1a914..c4f3dda7b496c9eac9a0d615b9b9ca4d99d15647 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -25,7 +25,7 @@ static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, i int tdAllocMemForCol(SDataCol *pCol, int maxPoints) { int spaceNeeded = pCol->bytes * maxPoints; if(IS_VAR_DATA_TYPE(pCol->type)) { - spaceNeeded += sizeof(VarDataOffsetT) * maxPoints; + spaceNeeded += sizeof(VarDataOffsetT) * maxPoints + sizeof(VarDataLenT) * maxPoints; } if(pCol->spaceSize < spaceNeeded) { void* ptr = realloc(pCol->pData, spaceNeeded);