fix(query): fix memory leak.
This commit is contained in:
parent
7b7a483afc
commit
2a45ef88b0
|
@ -1664,11 +1664,7 @@ static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* p
|
||||||
return handleErrorBeforePoll(pVg, pTmq);
|
return handleErrorBeforePoll(pVg, pTmq);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendInfo->msgInfo = (SDataBuf){
|
sendInfo->msgInfo = (SDataBuf){ .pData = msg, .len = msgSize, .handle = NULL };
|
||||||
.pData = msg,
|
|
||||||
.len = msgSize,
|
|
||||||
.handle = NULL,
|
|
||||||
};
|
|
||||||
|
|
||||||
sendInfo->requestId = req.reqId;
|
sendInfo->requestId = req.reqId;
|
||||||
sendInfo->requestObjRefId = 0;
|
sendInfo->requestObjRefId = 0;
|
||||||
|
|
|
@ -789,12 +789,6 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, STsd
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
pReader->status.pLDataIter = taosMemoryCalloc(pVnode->config.sttTrigger, sizeof(SLDataIter));
|
|
||||||
if (pReader->status.pLDataIter == NULL) {
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
goto _end;
|
|
||||||
}
|
|
||||||
|
|
||||||
ASSERT (pReader->suppInfo.colId[0] == PRIMARYKEY_TIMESTAMP_COL_ID);
|
ASSERT (pReader->suppInfo.colId[0] == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||||
pReader->status.pPrimaryTsCol = taosArrayGet(pResBlock->pDataBlock, pSup->slotId[0]);
|
pReader->status.pPrimaryTsCol = taosArrayGet(pResBlock->pDataBlock, pSup->slotId[0]);
|
||||||
|
|
||||||
|
@ -4388,6 +4382,12 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, void* pTableL
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pReader->status.pLDataIter = taosMemoryCalloc(pVnode->config.sttTrigger, sizeof(SLDataIter));
|
||||||
|
if (pReader->status.pLDataIter == NULL) {
|
||||||
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
goto _err;
|
||||||
|
}
|
||||||
|
|
||||||
pReader->suspended = true;
|
pReader->suspended = true;
|
||||||
|
|
||||||
if (countOnly) {
|
if (countOnly) {
|
||||||
|
@ -4487,7 +4487,7 @@ void tsdbReaderClose(STsdbReader* pReader) {
|
||||||
tsdbUninitReaderLock(pReader);
|
tsdbUninitReaderLock(pReader);
|
||||||
|
|
||||||
taosMemoryFreeClear(pReader->status.pLDataIter);
|
taosMemoryFreeClear(pReader->status.pLDataIter);
|
||||||
taosMemoryFree(pReader->status.uidList.tableUidList);
|
taosMemoryFreeClear(pReader->status.uidList.tableUidList);
|
||||||
SIOCostSummary* pCost = &pReader->cost;
|
SIOCostSummary* pCost = &pReader->cost;
|
||||||
|
|
||||||
SFilesetIter* pFilesetIter = &pReader->status.fileIter;
|
SFilesetIter* pFilesetIter = &pReader->status.fileIter;
|
||||||
|
|
Loading…
Reference in New Issue