From 2a27c2d8f4ec5d6e05df2d67538b9e507a8ba8f2 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 30 Nov 2022 14:09:06 +0800 Subject: [PATCH] fix coredump --- source/common/src/tmsg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 22f872c005..623816323f 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -6816,14 +6816,6 @@ void tDestroySSubmitTbData(SSubmitTbData *pTbData, int32_t flag) { if (flag == TSDB_MSG_FLG_ENCODE) { if (pTbData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT) { - int32_t nRow = TARRAY_SIZE(pTbData->aRowP); - SRow **rows = (SRow **)TARRAY_DATA(pTbData->aRowP); - - for (int32_t i = 0; i < nRow; ++i) { - tRowDestroy(rows[i]); - } - taosArrayDestroy(pTbData->aRowP); - } else { int32_t nColData = TARRAY_SIZE(pTbData->aCol); SColData *aColData = (SColData *)TARRAY_DATA(pTbData->aCol); @@ -6831,6 +6823,14 @@ void tDestroySSubmitTbData(SSubmitTbData *pTbData, int32_t flag) { tColDataDestroy(&aColData[i]); } taosArrayDestroy(pTbData->aCol); + } else { + int32_t nRow = TARRAY_SIZE(pTbData->aRowP); + SRow **rows = (SRow **)TARRAY_DATA(pTbData->aRowP); + + for (int32_t i = 0; i < nRow; ++i) { + tRowDestroy(rows[i]); + } + taosArrayDestroy(pTbData->aRowP); } } else if (flag == TSDB_MSG_FLG_DECODE) { if (pTbData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT) {