提交 77d95c27 编写于 作者: H Haojun Liao

[td-3299]fix the memory leak.

上级 d57b9459
......@@ -7190,7 +7190,8 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
SArray* list = taosArrayGetP(pSqlNode->from->list, 0);
SSqlNode* p = taosArrayGetP(list, 0);
code = validateSqlNode(pSql, p, NULL);
SQueryInfo* pQueryInfo = tscGetQueryInfo(&pSql->cmd, 0);
code = validateSqlNode(pSql, p, pQueryInfo);
if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) {
return code;
}
......@@ -7199,8 +7200,6 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
return code;
}
pQueryInfo = pCmd->pQueryInfo;
SQueryInfo* current = calloc(1, sizeof(SQueryInfo));
tscInitQueryInfo(current);
......@@ -7374,12 +7373,14 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
taosArrayPushBatch(pQueryInfo->exprList1, (void*) p, numOfExpr);
}
#if 0
SQueryNode* p = qCreateQueryPlan(pQueryInfo);
char* s = queryPlanToString(p);
printf("%s\n", s);
tfree(s);
qDestroyQueryPlan(p);
#endif
return TSDB_CODE_SUCCESS; // Does not build query message here
}
......
......@@ -2364,6 +2364,11 @@ static void freeQueryInfoImpl(SQueryInfo* pQueryInfo) {
tscExprDestroy(pQueryInfo->exprList);
pQueryInfo->exprList = NULL;
if (pQueryInfo->exprList1 != NULL) {
tscExprDestroy(pQueryInfo->exprList1);
pQueryInfo->exprList1 = NULL;
}
tscColumnListDestroy(pQueryInfo->colList);
pQueryInfo->colList = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册