fix mem leak

This commit is contained in:
yihaoDeng 2024-08-17 09:47:43 +08:00
parent d0beeea917
commit b6c3e75746
1 changed files with 5 additions and 6 deletions

View File

@ -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) {