From 37ae80d135a88a8aff3aa3ea970ed0a23c23fc66 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 19 Jul 2023 16:42:51 +0800 Subject: [PATCH] fix(tsdb): fix memory leak. --- source/dnode/vnode/src/tsdb/tsdbMergeTree.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 14c1d32b01..5ccbc3e33b 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -392,12 +392,9 @@ static bool existsFromSttBlkStatis(const TStatisBlkArray *pStatisBlkArray, uint6 tsdbSttFileReadStatisBlock(pReader, p, &block); int32_t index = tarray2SearchIdx(block.uid, &uid, sizeof(int64_t), uidComparFn, TD_EQ); - if (index == -1) { // has record, continue. - tStatisBlockDestroy(&block); - return false; - } + tStatisBlockDestroy(&block); - return true; + return (index != -1); } int32_t tLDataIterOpen2(struct SLDataIter *pIter, SSttFileReader *pSttFileReader, int32_t iStt, int8_t backward, -- GitLab