From 92a695cd2f3b68ca51ccb160d7967b5a6f7fd6e3 Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 8 Dec 2023 22:12:24 +0800 Subject: [PATCH] fix: memory leaks --- source/libs/executor/src/scanoperator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 77a4119be0..bea202f96d 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -3241,7 +3241,7 @@ static int32_t saveSourceBlock(STmsSortRowIdInfo* pSortInfo, const SSDataBlock* , .offset = pSortInfo->dataFileOffset, .length = szBlk}; taosLSeekFile(pSortInfo->idxFile, pSortInfo->blkId*sizeof(STmsSortBlockInfo), SEEK_SET); taosWriteFile(pSortInfo->idxFile, &info, sizeof(info)); - + *pSzBlk = szBlk; return 0; @@ -3525,7 +3525,9 @@ int32_t stopRowIdSort(STableMergeScanInfo *pInfo) { taosCloseFile(&pSort->dataFile); taosRemoveFile(pSort->dataPath); + taosLRUCacheEraseUnrefEntries(pSort->pBlkInfoCache); taosLRUCacheCleanup(pSort->pBlkInfoCache); + taosLRUCacheEraseUnrefEntries(pSort->pBlkDataCache); taosLRUCacheCleanup(pSort->pBlkDataCache); return 0; }