fix(query)[TD-31971]. Fix potential wild pointer access in tsdbReaderClose

Resolved an issue in tsdbReaderClose where wild pointer access could
occur in cases of insufficient memory or other exceptions.
This commit is contained in:
Jinqing Kuang 2024-09-09 17:23:34 +08:00
parent 1238960c75
commit 1ef8574429
1 changed files with 2 additions and 1 deletions

View File

@ -4580,6 +4580,8 @@ int32_t tsdbSetTableList2(STsdbReader* pReader, const void* pTableList, int32_t
clearBlockScanInfo(*p);
}
tSimpleHashClear(pReader->status.pTableMap);
if (size < num) {
code = ensureBlockScanInfoBuf(&pReader->blockInfoBuf, num);
if (code) {
@ -4596,7 +4598,6 @@ int32_t tsdbSetTableList2(STsdbReader* pReader, const void* pTableList, int32_t
pReader->status.uidList.tableUidList = (uint64_t*)p1;
}
tSimpleHashClear(pReader->status.pTableMap);
STableUidList* pUidList = &pReader->status.uidList;
pUidList->currentIndex = 0;