From c647372f94cc2774ac314cf469edf53ce877eeb0 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 28 Aug 2024 16:19:20 +0800 Subject: [PATCH] fix: add return value check --- source/common/src/tdataformat.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index 29bc13c81e..3bf0de0bdc 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -3318,7 +3318,7 @@ static int32_t tColDataMerge(SArray **colArr) { SColData *dstCol = taosArrayReserve(dst, 1); if (dstCol == NULL) { - code = TSDB_CODE_OUT_OF_MEMORY; + code = terrno; goto _exit; } tColDataInit(dstCol, srcCol->cid, srcCol->type, srcCol->cflag); @@ -3337,7 +3337,10 @@ static int32_t tColDataMerge(SArray **colArr) { SColVal cv; tColDataGetValue(srcCol, i, &cv); - tColDataAppendValue(dstCol, &cv); + code = tColDataAppendValue(dstCol, &cv); + if (code) { + goto _exit; + } } lastKey = key; } else { // update existing row @@ -3347,7 +3350,10 @@ static int32_t tColDataMerge(SArray **colArr) { SColVal cv; tColDataGetValue(srcCol, i, &cv); - tColDataUpdateValue(dstCol, &cv, true); + code = tColDataUpdateValue(dstCol, &cv, true); + if (code) { + goto _exit; + } } } }