fix:[TD-31654] Free memory at the end of substrIdxFunction to avoid memory leak.
This commit is contained in:
parent
676ad15e19
commit
734e59d5a7
|
@ -1544,9 +1544,15 @@ int32_t replaceFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pO
|
||||||
needFreeFrom = true;
|
needFreeFrom = true;
|
||||||
}
|
}
|
||||||
if (GET_PARAM_TYPE(&pInput[2]) != GET_PARAM_TYPE(&pInput[0])) {
|
if (GET_PARAM_TYPE(&pInput[2]) != GET_PARAM_TYPE(&pInput[0])) {
|
||||||
SCL_ERR_JRET(convBetweenNcharAndVarchar(varDataVal(colDataGetData(pInputData[2], colIdx3)), &toStr,
|
code = convBetweenNcharAndVarchar(varDataVal(colDataGetData(pInputData[2], colIdx3)), &toStr,
|
||||||
varDataLen(colDataGetData(pInputData[2], colIdx3)), &toLen,
|
varDataLen(colDataGetData(pInputData[2], colIdx3)), &toLen,
|
||||||
GET_PARAM_TYPE(&pInput[0])));
|
GET_PARAM_TYPE(&pInput[0]));
|
||||||
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
|
if (needFreeFrom) {
|
||||||
|
taosMemoryFree(fromStr);
|
||||||
|
}
|
||||||
|
goto _return;
|
||||||
|
}
|
||||||
needFreeTo = true;
|
needFreeTo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1660,9 +1666,9 @@ int32_t substrIdxFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *
|
||||||
|
|
||||||
SCL_ERR_JRET(colDataSetVal(pOutputData, k, output, false));
|
SCL_ERR_JRET(colDataSetVal(pOutputData, k, output, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
_return:
|
|
||||||
pOutput->numOfRows = numOfRows;
|
pOutput->numOfRows = numOfRows;
|
||||||
|
_return:
|
||||||
|
taosMemoryFree(outputBuf);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue