fix(query)[TD-33006]. resolve wild pointer release issue in tsdbCreateReader

Initialize pointer member variables in tsdbCreateReader to prevent
random memory errors. It addresses a bug where uninitialized pointers
are freed during error cleanup.
This commit is contained in:
Jinqing Kuang 2024-11-25 14:58:42 +08:00
parent 062a8a2831
commit ab7badb0c0
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ static int32_t setColumnIdSlotList(SBlockLoadSuppInfo* pSupInfo, SColumnInfo* pC
pSupInfo->smaValid = true;
pSupInfo->numOfCols = numOfCols;
pSupInfo->colId = taosMemoryMalloc(numOfCols * (sizeof(int16_t) * 2 + POINTER_BYTES));
pSupInfo->colId = taosMemoryCalloc(numOfCols, sizeof(int16_t) * 2 + POINTER_BYTES);
TSDB_CHECK_NULL(pSupInfo->colId, code, lino, _end, terrno);
pSupInfo->slotId = (int16_t*)((char*)pSupInfo->colId + (sizeof(int16_t) * numOfCols));