diff --git a/src/tsdb/src/tsdbFS.c b/src/tsdb/src/tsdbFS.c index 157806706786617cd88776314dfbe5907fcc72e4..7f26f06fff09ef8d6c1842d139b0a04d4fa58a0f 100644 --- a/src/tsdb/src/tsdbFS.c +++ b/src/tsdb/src/tsdbFS.c @@ -102,8 +102,8 @@ static int tsdbDecodeDFileSetArray(void **originBuf, void *buf, SArray *pArray, if (pSFSHeader->version == TSDB_FS_VER_0) { uint64_t extendedSize = pSFSHeader->len + nset * TSDB_FILE_MAX * sizeof(TSDB_FVER_TYPE); if (taosTSizeof(*originBuf) < extendedSize) { - size_t ptrDistance = (size_t)POINTER_DISTANCE(buf, *originBuf); - if (tsdbMakeRoom(originBuf, extendedSize) < 0) { + size_t ptrDistance = POINTER_DISTANCE(buf, *originBuf); + if (tsdbMakeRoom(originBuf, (size_t)extendedSize) < 0) { terrno = TSDB_CODE_FS_OUT_OF_MEMORY; return -1; }