Merge pull request #27541 from taosdata/fix/3.0/TD-31700
fix:[TD-31700] fix memory leak when error occurs in sclExecOperator.
This commit is contained in:
commit
b791f314df
|
@ -879,7 +879,7 @@ int32_t sclExecOperator(SOperatorNode *node, SScalarCtx *ctx, SScalarParam *outp
|
||||||
SScalarParam *params = NULL;
|
SScalarParam *params = NULL;
|
||||||
int32_t rowNum = 0;
|
int32_t rowNum = 0;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t paramNum = 0;
|
int32_t paramNum = scalarGetOperatorParamNum(node->opType);
|
||||||
|
|
||||||
// json not support in in operator
|
// json not support in in operator
|
||||||
if (nodeType(node->pLeft) == QUERY_NODE_VALUE) {
|
if (nodeType(node->pLeft) == QUERY_NODE_VALUE) {
|
||||||
|
@ -890,7 +890,7 @@ int32_t sclExecOperator(SOperatorNode *node, SScalarCtx *ctx, SScalarParam *outp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SCL_ERR_RET(sclInitOperatorParams(¶ms, node, ctx, &rowNum));
|
SCL_ERR_JRET(sclInitOperatorParams(¶ms, node, ctx, &rowNum));
|
||||||
if (output->columnData == NULL) {
|
if (output->columnData == NULL) {
|
||||||
code = sclCreateColumnInfoData(&node->node.resType, rowNum, output);
|
code = sclCreateColumnInfoData(&node->node.resType, rowNum, output);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
@ -900,7 +900,6 @@ int32_t sclExecOperator(SOperatorNode *node, SScalarCtx *ctx, SScalarParam *outp
|
||||||
|
|
||||||
_bin_scalar_fn_t OperatorFn = getBinScalarOperatorFn(node->opType);
|
_bin_scalar_fn_t OperatorFn = getBinScalarOperatorFn(node->opType);
|
||||||
|
|
||||||
paramNum = scalarGetOperatorParamNum(node->opType);
|
|
||||||
SScalarParam *pLeft = ¶ms[0];
|
SScalarParam *pLeft = ¶ms[0];
|
||||||
SScalarParam *pRight = paramNum > 1 ? ¶ms[1] : NULL;
|
SScalarParam *pRight = paramNum > 1 ? ¶ms[1] : NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue