fix mem leak

This commit is contained in:
dapan1121 2021-05-10 09:22:10 +08:00
parent 7e2345e371
commit fa3f970748
2 changed files with 7 additions and 2 deletions

View File

@ -1384,8 +1384,11 @@ int taos_stmt_close(TAOS_STMT* stmt) {
free(normal->parts); free(normal->parts);
free(normal->sql); free(normal->sql);
} else { } else {
taosHashCleanup(pStmt->mtb.pTableHash); if (pStmt->multiTbInsert) {
taosHashCleanup(pStmt->mtb.pTableBlockHashList); taosHashCleanup(pStmt->mtb.pTableHash);
pStmt->mtb.pTableBlockHashList = tscDestroyBlockHashTable(pStmt->mtb.pTableBlockHashList, true);
taosHashCleanup(pStmt->pSql->cmd.pTableBlockHashList);
}
} }
taos_free_result(pStmt->pSql); taos_free_result(pStmt->pSql);

View File

@ -2050,6 +2050,8 @@ int sql_perf_s1(TAOS *taos) {
free(sql[i]); free(sql[i]);
} }
free(sql);
return 0; return 0;
} }