fix(query): fix memory leak.
This commit is contained in:
parent
6470cfc26e
commit
6af9f279bc
|
@ -408,9 +408,7 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl
|
|||
|
||||
for (int32_t k = startIndex; k < endIndex; ++k) {
|
||||
code = tsdbSttFileReadStatisBlock(pSttFileReader, &pStatisBlkArray->data[k], &block);
|
||||
if (code) {
|
||||
return code;
|
||||
}
|
||||
QUERY_CHECK_CODE(code, lino, _end);
|
||||
|
||||
int32_t i = 0;
|
||||
int32_t rows = block.numOfRecords;
|
||||
|
@ -536,12 +534,15 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl
|
|||
}
|
||||
|
||||
_end:
|
||||
(void)tStatisBlockDestroy(&block);
|
||||
(void) tStatisBlockDestroy(&block);
|
||||
if (code != 0) {
|
||||
tsdbError("%s error happens at:%s line number: %d, code:%s", id, __FUNCTION__, lino, tstrerror(code));
|
||||
} else {
|
||||
double el = (taosGetTimestampUs() - st) / 1000.0;
|
||||
pBlockLoadInfo->cost.statisElapsedTime += el;
|
||||
|
||||
double el = (taosGetTimestampUs() - st) / 1000.0;
|
||||
pBlockLoadInfo->cost.statisElapsedTime += el;
|
||||
|
||||
tsdbDebug("%s load %d statis blocks into buf, elapsed time:%.2fms", id, num, el);
|
||||
tsdbDebug("%s load %d statis blocks into buf, elapsed time:%.2fms", id, num, el);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
|
@ -953,6 +954,7 @@ int32_t tMergeTreeOpen2(SMergeTree *pMTree, SMergeTreeConf *pConf, SSttDataInfoF
|
|||
pMTree->pIter = NULL;
|
||||
pMTree->backward = pConf->backward;
|
||||
pMTree->idStr = pConf->idstr;
|
||||
int32_t lino = 0;
|
||||
|
||||
if (!pMTree->backward) { // asc
|
||||
tRBTreeCreate(&pMTree->rbt, tLDataIterCmprFn);
|
||||
|
@ -1027,9 +1029,8 @@ int32_t tMergeTreeOpen2(SMergeTree *pMTree, SMergeTreeConf *pConf, SSttDataInfoF
|
|||
// let's record the time window for current table of uid in the stt files
|
||||
if (pSttDataInfo != NULL && numOfRows > 0) {
|
||||
void *px = taosArrayPush(pSttDataInfo->pKeyRangeList, &range);
|
||||
if (px == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
QUERY_CHECK_NULL(px, code, lino, _end, terrno);
|
||||
|
||||
pSttDataInfo->numOfRows += numOfRows;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue