diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index c6ef49535fc9a4c26dabe6e2fac40b69455f2184..dc2678e8c99fd41edf93dbbd6b9e5952406b5af0 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6330,6 +6330,7 @@ SOperatorInfo* createOrderOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorI pDataBlock->pDataBlock = taosArrayInit(numOfOutput, sizeof(SColumnInfoData)); if (pDataBlock->pDataBlock == NULL) { + free(pDataBlock); goto _clean; } @@ -8521,15 +8522,18 @@ SOperatorInfo* createSLimitOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperator SColIndex* idx = taosArrayGet(pInfo->orderColumnList, i); offset += pExpr[idx->colIndex].base.resBytes; } - - pInfo->pRes = createOutputBuf(pExpr, numOfOutput, pRuntimeEnv->resultInfo.capacity); - + SOperatorInfo* pOperator = calloc(1, sizeof(SOperatorInfo)); - - if (pInfo->pRes == NULL || pOperator == NULL) { + if (pOperator == NULL) { goto _clean; } - + + pInfo->pRes = createOutputBuf(pExpr, numOfOutput, pRuntimeEnv->resultInfo.capacity); + if (pInfo->pRes == NULL) { + tfree(pOperator); + goto _clean; + } + pOperator->name = "SLimitOperator"; pOperator->operatorType = OP_SLimit; pOperator->blockingOptr = false;