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

[td-3299]fix the memory leak.

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