From 1571ea844af5bdc52407326b37d081b1c9d55d24 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 1 Jun 2023 11:25:55 +0000 Subject: [PATCH] Avoid creating the same ID task multiple times --- source/libs/stream/src/streamMeta.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index e3f8b12367..8c26052fdb 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -367,16 +367,22 @@ int32_t streamLoadTasks(SStreamMeta* pMeta, int64_t ver) { tdbFree(pKey); tdbFree(pVal); tdbTbcClose(pCur); + taosMemoryFree(pTask); return -1; } taosArrayPush(pMeta->pTaskList, &pTask->id.taskId); } else { + tdbFree(pKey); + tdbFree(pVal); + tdbTbcClose(pCur); + taosMemoryFree(pTask); continue; } if (taosHashPut(pMeta->pTasks, &pTask->id.taskId, sizeof(pTask->id.taskId), &pTask, sizeof(void*)) < 0) { tdbFree(pKey); tdbFree(pVal); tdbTbcClose(pCur); + taosMemoryFree(pTask); return -1; } -- GitLab