diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index b4dfe481902b25576439fd8d531539510694868b..f22a2c093fcd673d5bfb025266375b8e6f1a02b9 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -415,6 +415,7 @@ int tsdbCloseMeta(STsdbRepo *pRepo) { while ((pNode = tdListPopHead(pMeta->superList)) != NULL) { tdListNodeGetData(pMeta->superList, pNode, (void *)(&pTable)); tsdbFreeTable(pTable); + listNodeFree(pNode); } tsdbTrace("vgId:%d TSDB meta is closed", REPO_ID(pRepo)); diff --git a/src/util/src/tlist.c b/src/util/src/tlist.c index 9e90815f611c8b09f8729b6453d639f30c0f321a..f402c2307e68cee6100a28e53dce1935af44fb3f 100644 --- a/src/util/src/tlist.c +++ b/src/util/src/tlist.c @@ -83,7 +83,7 @@ int tdListPrepend(SList *list, void *data) { } int tdListAppend(SList *list, void *data) { - SListNode *node = (SListNode *)malloc(sizeof(SListNode) + list->eleSize); + SListNode *node = (SListNode *)calloc(1, sizeof(SListNode) + list->eleSize); if (node == NULL) return -1; memcpy((void *)(node->data), data, list->eleSize);