fix: operator param free issue
This commit is contained in:
parent
caf737ab19
commit
099beff1cc
|
@ -310,39 +310,34 @@ static int32_t buildBatchExchangeOperatorParam(SOperatorParam** ppRes, int32_t d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int32_t buildMergeJoinOperatorParam(SOperatorParam** ppRes, bool initParam, SOperatorParam* pChild0, SOperatorParam* pChild1) {
|
static int32_t buildMergeJoinOperatorParam(SOperatorParam** ppRes, bool initParam, SOperatorParam** ppChild0, SOperatorParam** ppChild1) {
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
*ppRes = taosMemoryMalloc(sizeof(SOperatorParam));
|
*ppRes = taosMemoryMalloc(sizeof(SOperatorParam));
|
||||||
if (NULL == *ppRes) {
|
if (NULL == *ppRes) {
|
||||||
code = terrno;
|
code = terrno;
|
||||||
freeOperatorParam(pChild0, OP_GET_PARAM);
|
|
||||||
freeOperatorParam(pChild1, OP_GET_PARAM);
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
(*ppRes)->pChildren = taosArrayInit(2, POINTER_BYTES);
|
(*ppRes)->pChildren = taosArrayInit(2, POINTER_BYTES);
|
||||||
if (NULL == (*ppRes)->pChildren) {
|
if (NULL == (*ppRes)->pChildren) {
|
||||||
code = terrno;
|
code = terrno;
|
||||||
freeOperatorParam(pChild0, OP_GET_PARAM);
|
|
||||||
freeOperatorParam(pChild1, OP_GET_PARAM);
|
|
||||||
freeOperatorParam(*ppRes, OP_GET_PARAM);
|
freeOperatorParam(*ppRes, OP_GET_PARAM);
|
||||||
*ppRes = NULL;
|
*ppRes = NULL;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
if (NULL == taosArrayPush((*ppRes)->pChildren, &pChild0)) {
|
if (NULL == taosArrayPush((*ppRes)->pChildren, ppChild0)) {
|
||||||
code = terrno;
|
code = terrno;
|
||||||
freeOperatorParam(pChild0, OP_GET_PARAM);
|
|
||||||
freeOperatorParam(pChild1, OP_GET_PARAM);
|
|
||||||
freeOperatorParam(*ppRes, OP_GET_PARAM);
|
freeOperatorParam(*ppRes, OP_GET_PARAM);
|
||||||
*ppRes = NULL;
|
*ppRes = NULL;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
if (NULL == taosArrayPush((*ppRes)->pChildren, &pChild1)) {
|
*ppChild0 = NULL;
|
||||||
|
if (NULL == taosArrayPush((*ppRes)->pChildren, ppChild1)) {
|
||||||
code = terrno;
|
code = terrno;
|
||||||
freeOperatorParam(pChild1, OP_GET_PARAM);
|
|
||||||
freeOperatorParam(*ppRes, OP_GET_PARAM);
|
freeOperatorParam(*ppRes, OP_GET_PARAM);
|
||||||
*ppRes = NULL;
|
*ppRes = NULL;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
*ppChild1 = NULL;
|
||||||
|
|
||||||
SSortMergeJoinOperatorParam* pJoin = taosMemoryMalloc(sizeof(SSortMergeJoinOperatorParam));
|
SSortMergeJoinOperatorParam* pJoin = taosMemoryMalloc(sizeof(SSortMergeJoinOperatorParam));
|
||||||
if (NULL == pJoin) {
|
if (NULL == pJoin) {
|
||||||
|
@ -493,7 +488,7 @@ static int32_t buildSeqStbJoinOperatorParam(SDynQueryCtrlOperatorInfo* pInfo, SS
|
||||||
pSrcParam1 = NULL;
|
pSrcParam1 = NULL;
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = buildMergeJoinOperatorParam(ppParam, initParam, pGcParam0, pGcParam1);
|
code = buildMergeJoinOperatorParam(ppParam, initParam, &pGcParam0, &pGcParam1);
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
if (pSrcParam0) {
|
if (pSrcParam0) {
|
||||||
|
|
Loading…
Reference in New Issue