From 0f76b80408a2d5ab1115ee956ad728b37982983f Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 27 Aug 2024 11:27:22 +0800 Subject: [PATCH] check function return code --- source/libs/index/src/indexUtil.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/libs/index/src/indexUtil.c b/source/libs/index/src/indexUtil.c index 1139837dc9..9568e18a3e 100644 --- a/source/libs/index/src/indexUtil.c +++ b/source/libs/index/src/indexUtil.c @@ -207,6 +207,7 @@ void idxTRsltDestroy(SIdxTRslt *tr) { taosMemoryFree(tr); } int32_t idxTRsltMergeTo(SIdxTRslt *tr, SArray *result) { + int32_t code = 0; taosArraySort(tr->total, uidCompare); taosArraySort(tr->add, uidCompare); taosArraySort(tr->del, uidCompare); @@ -229,9 +230,11 @@ int32_t idxTRsltMergeTo(SIdxTRslt *tr, SArray *result) { taosArrayDestroy(arrs); return TSDB_CODE_OUT_OF_MEMORY; } - iUnion(arrs, result); + code = iUnion(arrs, result); taosArrayDestroy(arrs); } - iExcept(result, tr->del); - return 0; + if (code == 0) { + code = iExcept(result, tr->del); + } + return code; }