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:
parent
1238960c75
commit
1ef8574429
|
@ -4580,6 +4580,8 @@ int32_t tsdbSetTableList2(STsdbReader* pReader, const void* pTableList, int32_t
|
||||||
clearBlockScanInfo(*p);
|
clearBlockScanInfo(*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tSimpleHashClear(pReader->status.pTableMap);
|
||||||
|
|
||||||
if (size < num) {
|
if (size < num) {
|
||||||
code = ensureBlockScanInfoBuf(&pReader->blockInfoBuf, num);
|
code = ensureBlockScanInfoBuf(&pReader->blockInfoBuf, num);
|
||||||
if (code) {
|
if (code) {
|
||||||
|
@ -4596,7 +4598,6 @@ int32_t tsdbSetTableList2(STsdbReader* pReader, const void* pTableList, int32_t
|
||||||
pReader->status.uidList.tableUidList = (uint64_t*)p1;
|
pReader->status.uidList.tableUidList = (uint64_t*)p1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tSimpleHashClear(pReader->status.pTableMap);
|
|
||||||
STableUidList* pUidList = &pReader->status.uidList;
|
STableUidList* pUidList = &pReader->status.uidList;
|
||||||
pUidList->currentIndex = 0;
|
pUidList->currentIndex = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue