fix: nodes free issue

This commit is contained in:
dapan1121 2023-04-17 15:44:15 +08:00
parent 31d187444e
commit ed3778dc9f
3 changed files with 3 additions and 2 deletions

View File

@ -306,6 +306,7 @@ void nodesDestroyAllocator(int64_t allocatorId);
SNode* nodesMakeNode(ENodeType type);
void nodesDestroyNode(SNode* pNode);
void nodesFree(void* p);
SNodeList* nodesMakeList();
int32_t nodesListAppend(SNodeList* pList, SNode* pNode);

View File

@ -486,7 +486,7 @@ int32_t getColInfoResultForGroupby(void* metaHandle, SNodeList* group, STableLis
SNodeListNode* listNode = (SNodeListNode*)nodesMakeNode(QUERY_NODE_NODE_LIST);
listNode->pNodeList = group;
genTagFilterDigest((SNode *)listNode, &context);
taosMemoryFree(listNode);
nodesFree(listNode);
if (lastTableList && (0 == memcmp(context.digest, lastMd5.digest, sizeof(lastMd5.digest)) && (taosArrayGetSize(pTableListInfo->pTableList) == taosArrayGetSize(lastTableList)))) {
pTableListInfo->pTableList = taosArrayDup(lastTableList, NULL);

View File

@ -87,7 +87,7 @@ static void* nodesCalloc(int32_t num, int32_t size) {
return (char*)p + 1;
}
static void nodesFree(void* p) {
void nodesFree(void* p) {
char* ptr = (char*)p - 1;
if (0 == *ptr) {
taosMemoryFree(ptr);