提交 2c2d5c16 编写于 作者: D dapan1121

fix: fix insert memory leak

上级 4fd0bc40
...@@ -414,6 +414,9 @@ int32_t hbGetQueryBasicInfo(SClientHbKey *connKey, SClientHbReq *req) { ...@@ -414,6 +414,9 @@ int32_t hbGetQueryBasicInfo(SClientHbKey *connKey, SClientHbReq *req) {
int32_t code = hbBuildQueryDesc(hbBasic, pTscObj); int32_t code = hbBuildQueryDesc(hbBasic, pTscObj);
if (code) { if (code) {
releaseTscObj(connKey->tscRid); releaseTscObj(connKey->tscRid);
if (hbBasic->queryDesc) {
taosArrayDestroyEx(hbBasic->queryDesc, tFreeClientHbQueryDesc);
}
taosMemoryFree(hbBasic); taosMemoryFree(hbBasic);
return code; return code;
} }
......
...@@ -1420,9 +1420,7 @@ static int32_t parseDataFromFile(SInsertParseContext* pCxt, SToken filePath, STa ...@@ -1420,9 +1420,7 @@ static int32_t parseDataFromFile(SInsertParseContext* pCxt, SToken filePath, STa
} }
static void destroyInsertParseContextForTable(SInsertParseContext* pCxt) { static void destroyInsertParseContextForTable(SInsertParseContext* pCxt) {
if (!pCxt->pComCxt->async) { taosMemoryFreeClear(pCxt->pTableMeta);
taosMemoryFreeClear(pCxt->pTableMeta);
}
destroyBoundColumnInfo(&pCxt->tags); destroyBoundColumnInfo(&pCxt->tags);
tdDestroySVCreateTbReq(&pCxt->createTblReq); tdDestroySVCreateTbReq(&pCxt->createTblReq);
} }
......
...@@ -1124,7 +1124,7 @@ int32_t getTableMetaFromCacheForInsert(SArray* pTableMetaPos, SParseMetaCache* p ...@@ -1124,7 +1124,7 @@ int32_t getTableMetaFromCacheForInsert(SArray* pTableMetaPos, SParseMetaCache* p
int32_t reqIndex = *(int32_t*)taosArrayGet(pTableMetaPos, tableNo); int32_t reqIndex = *(int32_t*)taosArrayGet(pTableMetaPos, tableNo);
SMetaRes* pRes = taosArrayGet(pMetaCache->pTableMetaData, reqIndex); SMetaRes* pRes = taosArrayGet(pMetaCache->pTableMetaData, reqIndex);
if (TSDB_CODE_SUCCESS == pRes->code) { if (TSDB_CODE_SUCCESS == pRes->code) {
*pMeta = pRes->pRes; *pMeta = tableMetaDup(pRes->pRes);
if (NULL == *pMeta) { if (NULL == *pMeta) {
return TSDB_CODE_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册