From 0f8ff48c6ba3edacd119dc363625c69a719f244a Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 23 Apr 2024 18:18:01 +0800 Subject: [PATCH] fix(stream): fix double free --- source/common/src/tmsg.c | 2 ++ source/dnode/vnode/src/tq/tqSink.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 340463e48c..6c2358a1d7 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -9624,6 +9624,8 @@ void tDestroySubmitTbData(SSubmitTbData *pTbData, int32_t flag) { taosArrayDestroy(pTbData->aRowP); } } + + pTbData->aRowP = NULL; } void tDestroySubmitReq(SSubmitReq2 *pReq, int32_t flag) { diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index 1da096224c..f690b9b277 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -583,7 +583,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat if (IS_SET_NULL(pCol)) { if (pCol->flags & COL_IS_KEY) { - qError("ts:%" PRId64 " Primary key column should not be null, colId:%" PRIi16 ", colType:%" PRIi8, ts, + qError("ts:%" PRId64 " primary key column should not be null, colId:%" PRIi16 ", colType:%" PRIi8, ts, pCol->colId, pCol->type); break; } @@ -593,7 +593,7 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat SColumnInfoData* pColData = taosArrayGet(pDataBlock->pDataBlock, dataIndex); if (colDataIsNull_s(pColData, j)) { if (pCol->flags & COL_IS_KEY) { - qError("ts:%" PRId64 "Primary key column should not be null, colId:%" PRIi16 ", colType:%" PRIi8, + qError("ts:%" PRId64 " primary key column should not be null, colId:%" PRIi16 ", colType:%" PRIi8, ts, pCol->colId, pCol->type); break; } @@ -624,8 +624,8 @@ int32_t doConvertRows(SSubmitTbData* pTableData, const STSchema* pTSchema, SSDat code = tRowBuild(pVals, (STSchema*)pTSchema, &pRow); if (code != TSDB_CODE_SUCCESS) { tDestroySubmitTbData(pTableData, TSDB_MSG_FLG_ENCODE); - pTableData->aRowP = taosArrayDestroy(pTableData->aRowP); taosArrayDestroy(pVals); + tqError("s-task:%s build rows for submit failed, ts:%"PRId64, id, ts); return code; }