提交 ed3778dc 编写于 作者: D dapan1121

fix: nodes free issue

上级 31d18744
...@@ -306,6 +306,7 @@ void nodesDestroyAllocator(int64_t allocatorId); ...@@ -306,6 +306,7 @@ void nodesDestroyAllocator(int64_t allocatorId);
SNode* nodesMakeNode(ENodeType type); SNode* nodesMakeNode(ENodeType type);
void nodesDestroyNode(SNode* pNode); void nodesDestroyNode(SNode* pNode);
void nodesFree(void* p);
SNodeList* nodesMakeList(); SNodeList* nodesMakeList();
int32_t nodesListAppend(SNodeList* pList, SNode* pNode); int32_t nodesListAppend(SNodeList* pList, SNode* pNode);
......
...@@ -486,7 +486,7 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis ...@@ -486,7 +486,7 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis
SNodeListNode* listNode = (SNodeListNode*)nodesMakeNode(QUERY_NODE_NODE_LIST); SNodeListNode* listNode = (SNodeListNode*)nodesMakeNode(QUERY_NODE_NODE_LIST);
listNode->pNodeList = group; listNode->pNodeList = group;
genTagFilterDigest((SNode *)listNode, &context); genTagFilterDigest((SNode *)listNode, &context);
taosMemoryFree(listNode); nodesFree(listNode);
if (lastTableList && (0 == memcmp(context.digest, lastMd5.digest, sizeof(lastMd5.digest)) && (taosArrayGetSize(pTableListInfo->pTableList) == taosArrayGetSize(lastTableList)))) { if (lastTableList && (0 == memcmp(context.digest, lastMd5.digest, sizeof(lastMd5.digest)) && (taosArrayGetSize(pTableListInfo->pTableList) == taosArrayGetSize(lastTableList)))) {
pTableListInfo->pTableList = taosArrayDup(lastTableList, NULL); pTableListInfo->pTableList = taosArrayDup(lastTableList, NULL);
......
...@@ -87,7 +87,7 @@ static void* nodesCalloc(int32_t num, int32_t size) { ...@@ -87,7 +87,7 @@ static void* nodesCalloc(int32_t num, int32_t size) {
return (char*)p + 1; return (char*)p + 1;
} }
static void nodesFree(void* p) { void nodesFree(void* p) {
char* ptr = (char*)p - 1; char* ptr = (char*)p - 1;
if (0 == *ptr) { if (0 == *ptr) {
taosMemoryFree(ptr); taosMemoryFree(ptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册