提交 8c74800b 编写于 作者: A Alex Duan

fix TS-597 on develop. free sa->colList befor re-calloc

上级 1a730894
......@@ -1184,8 +1184,8 @@ static TSKEY getStartTsKey(SQueryAttr* pQueryAttr, STimeWindow* win, const TSKEY
static void setArithParams(SArithmeticSupport* sas, SExprInfo *pExprInfo, SSDataBlock* pSDataBlock) {
sas->numOfCols = (int32_t) pSDataBlock->info.numOfCols;
sas->pExprInfo = pExprInfo;
if (sas->colList != NULL) {
return;
if (sas->colList) {
free(sas->colList); // free pre malloc memory
}
sas->colList = calloc(1, pSDataBlock->info.numOfCols*sizeof(SColumnInfo));
for(int32_t i = 0; i < sas->numOfCols; ++i) {
......@@ -1193,6 +1193,9 @@ static void setArithParams(SArithmeticSupport* sas, SExprInfo *pExprInfo, SSData
sas->colList[i] = pColData->info;
}
if(sas->data) {
free(sas->data); // free pre malloc memory
}
sas->data = calloc(sas->numOfCols, POINTER_BYTES);
// set the input column data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册