提交 748df842 编写于 作者: H Hongze Cheng

fix memory leakage

上级 03c19aa8
...@@ -587,6 +587,7 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) { ...@@ -587,6 +587,7 @@ char *metaTbCursorNext(SMTbCursor *pTbCur) {
pBuf = value.data; pBuf = value.data;
metaDecodeTbInfo(pBuf, &tbCfg); metaDecodeTbInfo(pBuf, &tbCfg);
if (tbCfg.type == META_SUPER_TABLE) { if (tbCfg.type == META_SUPER_TABLE) {
free(tbCfg.name);
free(tbCfg.stbCfg.pTagSchema); free(tbCfg.stbCfg.pTagSchema);
continue; continue;
} else if (tbCfg.type == META_CHILD_TABLE) { } else if (tbCfg.type == META_CHILD_TABLE) {
......
...@@ -82,6 +82,7 @@ STQ* tqOpen(const char* path, SWal* pWal, SMeta* pMeta, STqCfg* tqConfig, SMemAl ...@@ -82,6 +82,7 @@ STQ* tqOpen(const char* path, SWal* pWal, SMeta* pMeta, STqCfg* tqConfig, SMemAl
void tqClose(STQ* pTq) { void tqClose(STQ* pTq) {
if (pTq) { if (pTq) {
tfree(pTq->path);
free(pTq); free(pTq);
} }
// TODO // TODO
......
...@@ -114,3 +114,4 @@ static void vArenaNodeFree(SVArenaNode *pNode) { ...@@ -114,3 +114,4 @@ static void vArenaNodeFree(SVArenaNode *pNode) {
if (pNode) { if (pNode) {
free(pNode); free(pNode);
} }
}
...@@ -217,6 +217,7 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) { ...@@ -217,6 +217,7 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
STR_TO_VARSTR(p, n); STR_TO_VARSTR(p, n);
p += (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE); p += (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE);
free(n);
} }
pFetchRsp->numOfRows = htonl(numOfTables); pFetchRsp->numOfRows = htonl(numOfTables);
...@@ -231,10 +232,6 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) { ...@@ -231,10 +232,6 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
}; };
rpcSendResponse(&rpcMsg); rpcSendResponse(&rpcMsg);
for (int i = 0; i < taosArrayGetSize(pArray); i++) {
name = *(char **)taosArrayGet(pArray, i);
free(name);
}
taosArrayDestroyEx(pArray, freeItemHelper); taosArrayDestroyEx(pArray, freeItemHelper);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册