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,20 +318,19 @@ void streamFreeTaskState(SStreamTask* pTask, int8_t remove) {
taskDbRemoveRef(pTask->pBackend); taskDbRemoveRef(pTask->pBackend);
pTask->pBackend = NULL; pTask->pBackend = NULL;
pTask->pState = NULL; pTask->pState = NULL;
if (pTask->backendPath != NULL) {
taosMemoryFree(pTask->backendPath);
pTask->backendPath = NULL;
}
} else { } else {
if (remove) { if (remove) {
if (pTask->backendPath != NULL) { if (pTask->backendPath != NULL) {
taosRemoveDir(pTask->backendPath); taosRemoveDir(pTask->backendPath);
}
}
}
if (pTask->backendPath != NULL) {
taosMemoryFree(pTask->backendPath); taosMemoryFree(pTask->backendPath);
pTask->backendPath = NULL; pTask->backendPath = NULL;
} }
} }
}
}
static void setInitialVersionInfo(SStreamTask* pTask, int64_t ver) { static void setInitialVersionInfo(SStreamTask* pTask, int64_t ver) {
SCheckpointInfo* pChkInfo = &pTask->chkInfo; SCheckpointInfo* pChkInfo = &pTask->chkInfo;