diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index 0a8d7ee376b9a92a7c4bc5fb7544de0f6bb77030..7226e983234f31792a538380a76377b3d5a749e3 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -995,7 +995,12 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) { SArray* aExtSrc = taosArrayInit(nSrc, POINTER_BYTES); size_t maxBufSize = pHandle->numOfPages * pHandle->pageSize; - createPageBuf(pHandle); + + int32_t code = createPageBuf(pHandle); + if (code != TSDB_CODE_SUCCESS) { + taosArrayDestroy(aExtSrc); + return code; + } SSortSource* pSrc = taosArrayGetP(pHandle->pOrderedSource, 0); int32_t szSort = 0; @@ -1070,7 +1075,7 @@ static int32_t createBlocksMergeSortInitialSources(SSortHandle* pHandle) { taosArrayDestroy(aExtSrc); pHandle->type = SORT_SINGLESOURCE_SORT; - return 0; + return TSDB_CODE_SUCCESS; } static int32_t createBlocksQuickSortInitialSources(SSortHandle* pHandle) {