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:
Pan Wei 2024-08-29 19:19:05 +08:00 committed by GitHub
commit b791f314df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -879,7 +879,7 @@ int32_t sclExecOperator(SOperatorNode *node, SScalarCtx *ctx, SScalarParam *outp
SScalarParam *params = NULL;
int32_t rowNum = 0;
int32_t code = 0;
int32_t paramNum = 0;
int32_t paramNum = scalarGetOperatorParamNum(node->opType);
// json not support in in operator
if (nodeType(node->pLeft) == QUERY_NODE_VALUE) {
@ -890,7 +890,7 @@ int32_t sclExecOperator(SOperatorNode *node, SScalarCtx *ctx, SScalarParam *outp
}
}
SCL_ERR_RET(sclInitOperatorParams(&params, node, ctx, &rowNum));
SCL_ERR_JRET(sclInitOperatorParams(&params, node, ctx, &rowNum));
if (output->columnData == NULL) {
code = sclCreateColumnInfoData(&node->node.resType, rowNum, output);
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);
paramNum = scalarGetOperatorParamNum(node->opType);
SScalarParam *pLeft = &params[0];
SScalarParam *pRight = paramNum > 1 ? &params[1] : NULL;