Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
69587b3c
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
69587b3c
编写于
4月 02, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]fix memory leaks.
上级
25d959b9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
9 deletion
+20
-9
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-0
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+2
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+17
-8
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
69587b3c
...
@@ -440,6 +440,7 @@ void tscRestoreFuncForSTableQuery(SQueryInfo *pQueryInfo);
...
@@ -440,6 +440,7 @@ void tscRestoreFuncForSTableQuery(SQueryInfo *pQueryInfo);
int32_t
tscCreateResPointerInfo
(
SSqlRes
*
pRes
,
SQueryInfo
*
pQueryInfo
);
int32_t
tscCreateResPointerInfo
(
SSqlRes
*
pRes
,
SQueryInfo
*
pQueryInfo
);
void
tscSetResRawPtr
(
SSqlRes
*
pRes
,
SQueryInfo
*
pQueryInfo
);
void
tscSetResRawPtr
(
SSqlRes
*
pRes
,
SQueryInfo
*
pQueryInfo
);
void
destroyTableNameList
(
SSqlCmd
*
pCmd
);
void
tscResetSqlCmd
(
SSqlCmd
*
pCmd
,
bool
removeMeta
);
void
tscResetSqlCmd
(
SSqlCmd
*
pCmd
,
bool
removeMeta
);
...
...
src/client/src/tscParseInsert.c
浏览文件 @
69587b3c
...
@@ -1420,7 +1420,8 @@ static void parseFileSendDataBlock(void *param, TAOS_RES *tres, int32_t numOfRow
...
@@ -1420,7 +1420,8 @@ static void parseFileSendDataBlock(void *param, TAOS_RES *tres, int32_t numOfRow
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
STableComInfo
tinfo
=
tscGetTableInfo
(
pTableMeta
);
STableComInfo
tinfo
=
tscGetTableInfo
(
pTableMeta
);
tfree
(
pCmd
->
pTableNameList
);
destroyTableNameList
(
pCmd
);
pCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pCmd
->
pDataBlocks
);
pCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pCmd
->
pDataBlocks
);
if
(
pCmd
->
pTableBlockHashList
==
NULL
)
{
if
(
pCmd
->
pTableBlockHashList
==
NULL
)
{
...
...
src/client/src/tscUtil.c
浏览文件 @
69587b3c
...
@@ -415,6 +415,20 @@ void tscFreeQueryInfo(SSqlCmd* pCmd, bool removeMeta) {
...
@@ -415,6 +415,20 @@ void tscFreeQueryInfo(SSqlCmd* pCmd, bool removeMeta) {
tfree
(
pCmd
->
pQueryInfo
);
tfree
(
pCmd
->
pQueryInfo
);
}
}
void
destroyTableNameList
(
SSqlCmd
*
pCmd
)
{
if
(
pCmd
->
numOfTables
==
0
)
{
assert
(
pCmd
->
pTableNameList
==
NULL
);
return
;
}
for
(
int32_t
i
=
0
;
i
<
pCmd
->
numOfTables
;
++
i
)
{
tfree
(
pCmd
->
pTableNameList
[
i
]);
}
pCmd
->
numOfTables
=
0
;
tfree
(
pCmd
->
pTableNameList
);
}
void
tscResetSqlCmd
(
SSqlCmd
*
pCmd
,
bool
removeMeta
)
{
void
tscResetSqlCmd
(
SSqlCmd
*
pCmd
,
bool
removeMeta
)
{
pCmd
->
command
=
0
;
pCmd
->
command
=
0
;
pCmd
->
numOfCols
=
0
;
pCmd
->
numOfCols
=
0
;
...
@@ -424,14 +438,7 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool removeMeta) {
...
@@ -424,14 +438,7 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool removeMeta) {
pCmd
->
parseFinished
=
0
;
pCmd
->
parseFinished
=
0
;
pCmd
->
autoCreated
=
0
;
pCmd
->
autoCreated
=
0
;
for
(
int32_t
i
=
0
;
i
<
pCmd
->
numOfTables
;
++
i
)
{
destroyTableNameList
(
pCmd
);
if
(
pCmd
->
pTableNameList
&&
pCmd
->
pTableNameList
[
i
])
{
tfree
(
pCmd
->
pTableNameList
[
i
]);
}
}
pCmd
->
numOfTables
=
0
;
tfree
(
pCmd
->
pTableNameList
);
pCmd
->
pTableBlockHashList
=
tscDestroyBlockHashTable
(
pCmd
->
pTableBlockHashList
,
removeMeta
);
pCmd
->
pTableBlockHashList
=
tscDestroyBlockHashTable
(
pCmd
->
pTableBlockHashList
,
removeMeta
);
pCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pCmd
->
pDataBlocks
);
pCmd
->
pDataBlocks
=
tscDestroyBlockArrayList
(
pCmd
->
pDataBlocks
);
...
@@ -840,6 +847,8 @@ static void extractTableNameList(SSqlCmd* pCmd, bool freeBlockMap) {
...
@@ -840,6 +847,8 @@ static void extractTableNameList(SSqlCmd* pCmd, bool freeBlockMap) {
int32_t
i
=
0
;
int32_t
i
=
0
;
while
(
p1
)
{
while
(
p1
)
{
STableDataBlocks
*
pBlocks
=
*
p1
;
STableDataBlocks
*
pBlocks
=
*
p1
;
tfree
(
pCmd
->
pTableNameList
[
i
]);
pCmd
->
pTableNameList
[
i
++
]
=
tNameDup
(
&
pBlocks
->
tableName
);
pCmd
->
pTableNameList
[
i
++
]
=
tNameDup
(
&
pBlocks
->
tableName
);
p1
=
taosHashIterate
(
pCmd
->
pTableBlockHashList
,
p1
);
p1
=
taosHashIterate
(
pCmd
->
pTableBlockHashList
,
p1
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录