diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index caa3ba3cf33a33ab4ca87bec2255d7bff8e678d7..cd8470883b185cde1393ece684f5ad2a33ba462c 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -109,6 +109,10 @@ static int32_t sortComparClearup(SMsortComparParam* cmpParam) { } void tsortDestroySortHandle(SSortHandle* pSortHandle) { + if (pSortHandle == NULL) { + return; + } + tsortClose(pSortHandle); if (pSortHandle->pMergeTree != NULL) { tMergeTreeDestroy(pSortHandle->pMergeTree);