diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index 77bac6cee7..a9c8ffca0c 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -77,9 +77,11 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, SStreamQueueItem* pItem, i int32_t size = 0; int32_t numOfBlocks = 0; - SArray* pRes = taosArrayInit(0, sizeof(SSDataBlock)); + SArray* pRes = NULL; while (1) { + pRes = taosArrayInit(4, sizeof(SSDataBlock)); + if (streamTaskShouldStop(&pTask->status)) { taosArrayDestroy(pRes); // memory leak return 0;