diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index b4dfe48190..f22a2c093f 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 9e90815f61..f402c2307e 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);