From 4f38126c6d20bbe6450504dd8d5bdbcaf1e0519b Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sat, 31 Aug 2024 09:10:55 +0800 Subject: [PATCH] check func ret --- source/libs/index/src/index.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/libs/index/src/index.c b/source/libs/index/src/index.c index 7c5822b90a..0d834a68cb 100644 --- a/source/libs/index/src/index.c +++ b/source/libs/index/src/index.c @@ -569,6 +569,7 @@ static int32_t idxMayMergeTempToFinalRslt(SArray* result, TFileValue* tfv, SIdxT indexFatal("failed to merge result since %s", tstrerror(code)); } } else { + tfileValueDestroy(tfv); return 0; } } else { @@ -591,6 +592,7 @@ static int32_t idxMergeCacheAndTFile(SArray* result, IterateValue* cv, IterateVa tfileValueDestroy(tfv); return code; } + tfv = NULL; if (cv != NULL) { uint64_t id = *(uint64_t*)taosArrayGet(cv->val, 0); @@ -601,19 +603,11 @@ static int32_t idxMergeCacheAndTFile(SArray* result, IterateValue* cv, IterateVa INDEX_MERGE_ADD_DEL(tr->add, tr->del, id) } } - - if (code != 0) { - tfileValueDestroy(tfv); - return code; - } - if (tv != NULL) { if (taosArrayAddAll(tr->total, tv->val) == NULL) { - tfileValueDestroy(tfv); return TSDB_CODE_OUT_OF_MEMORY; } } - tfileValueDestroy(tfv); return 0; } static void idxDestroyFinalRslt(SArray* result) {