提交 6b985a6e 编写于 作者: H Haojun Liao

[td-1764] fix memory leak.

上级 58e1f852
......@@ -510,7 +510,8 @@ void tscDestroyLocalReducer(SSqlObj *pSql) {
taosTFree(pLocalReducer->pResultBuf);
if (pLocalReducer->pResInfo != NULL) {
for (int32_t i = 0; i < pQueryInfo->fieldsInfo.numOfOutput; ++i) {
size_t num = tscSqlExprNumOfExprs(pQueryInfo);
for (int32_t i = 0; i < num; ++i) {
taosTFree(pLocalReducer->pResInfo[i].interResultBuf);
}
......
......@@ -972,6 +972,8 @@ void tscFieldInfoClear(SFieldInfo* pFieldInfo) {
}
taosArrayDestroy(pFieldInfo->internalField);
taosTFree(pFieldInfo->final);
memset(pFieldInfo, 0, sizeof(SFieldInfo));
}
......@@ -1834,7 +1836,7 @@ static void doSetSqlExprAndResultFieldInfo(SQueryInfo* pQueryInfo, SQueryInfo* p
return;
}
// set the field info in pNewQueryInfo object
// set the field info in pNewQueryInfo object according to sqlExpr information
size_t numOfExprs = tscSqlExprNumOfExprs(pNewQueryInfo);
for (int32_t i = 0; i < numOfExprs; ++i) {
SSqlExpr* pExpr = tscSqlExprGet(pNewQueryInfo, i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册