From b6c3e7574696482615d76a55ca5467c1b230c81e Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sat, 17 Aug 2024 09:47:43 +0800 Subject: [PATCH] fix mem leak --- source/libs/stream/src/streamTask.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index fc72489ee6..1cbbcac046 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -318,19 +318,18 @@ void streamFreeTaskState(SStreamTask* pTask, int8_t remove) { taskDbRemoveRef(pTask->pBackend); pTask->pBackend = NULL; pTask->pState = NULL; - if (pTask->backendPath != NULL) { - taosMemoryFree(pTask->backendPath); - pTask->backendPath = NULL; - } } else { if (remove) { if (pTask->backendPath != NULL) { taosRemoveDir(pTask->backendPath); - taosMemoryFree(pTask->backendPath); - pTask->backendPath = NULL; } } } + + if (pTask->backendPath != NULL) { + taosMemoryFree(pTask->backendPath); + pTask->backendPath = NULL; + } } static void setInitialVersionInfo(SStreamTask* pTask, int64_t ver) {