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:
parent
062a8a2831
commit
ab7badb0c0
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue