fix memory leakage

This commit is contained in:
Hongze Cheng 2022-01-24 06:57:00 +00:00
parent 03c19aa887
commit 748df84238
4 changed files with 4 additions and 4 deletions

View File

@ -587,6 +587,7 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) {
pBuf = value.data;
metaDecodeTbInfo(pBuf, &tbCfg);
if (tbCfg.type == META_SUPER_TABLE) {
free(tbCfg.name);
free(tbCfg.stbCfg.pTagSchema);
continue;
} else if (tbCfg.type == META_CHILD_TABLE) {

View File

@ -82,6 +82,7 @@ STQ* tqOpen(const char* path, SWal* pWal, SMeta* pMeta, STqCfg* tqConfig, SMemAl
void tqClose(STQ* pTq) {
if (pTq) {
tfree(pTq->path);
free(pTq);
}
// TODO

View File

@ -114,3 +114,4 @@ static void vArenaNodeFree(SVArenaNode *pNode) {
if (pNode) {
free(pNode);
}
}

View File

@ -217,6 +217,7 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
STR_TO_VARSTR(p, n);
p += (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE);
free(n);
}
pFetchRsp->numOfRows = htonl(numOfTables);
@ -231,10 +232,6 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
};
rpcSendResponse(&rpcMsg);
for (int i = 0; i < taosArrayGetSize(pArray); i++) {
name = *(char **)taosArrayGet(pArray, i);
free(name);
}
taosArrayDestroyEx(pArray, freeItemHelper);
return 0;