From d4c739414300a31e681fe236974ad5bcc47f01f5 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 22 Nov 2022 22:03:08 +0800 Subject: [PATCH] fix(stream): memory leak --- source/dnode/vnode/src/tq/tqPush.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c index 12d5b4112b..f89bc20362 100644 --- a/source/dnode/vnode/src/tq/tqPush.c +++ b/source/dnode/vnode/src/tq/tqPush.c @@ -308,9 +308,8 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) } if (vnodeIsRoleLeader(pTq->pVnode)) { + if (taosHashGetSize(pTq->pStreamMeta->pTasks) == 0) return 0; if (msgType == TDMT_VND_SUBMIT) { - if (taosHashGetSize(pTq->pStreamMeta->pTasks) == 0) return 0; - void* data = taosMemoryMalloc(msgLen); if (data == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; -- GitLab