Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4fd0bc40
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
4fd0bc40
编写于
9月 13, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix client/server memory leak issues
上级
2c83fee4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
20 deletion
+27
-20
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-0
source/client/src/clientMain.c
source/client/src/clientMain.c
+2
-0
source/client/src/clientRawBlockWrite.c
source/client/src/clientRawBlockWrite.c
+6
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-0
source/libs/catalog/src/ctgUtil.c
source/libs/catalog/src/ctgUtil.c
+10
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+6
-19
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
4fd0bc40
...
...
@@ -854,6 +854,7 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
pRequest
->
metric
.
resultReady
=
taosGetTimestampUs
();
if
(
pResult
)
{
destroyQueryExecRes
(
&
pRequest
->
body
.
resInfo
.
execRes
);
memcpy
(
&
pRequest
->
body
.
resInfo
.
execRes
,
pResult
,
sizeof
(
*
pResult
));
}
...
...
source/client/src/clientMain.c
浏览文件 @
4fd0bc40
...
...
@@ -870,11 +870,13 @@ static void fetchCallback(void *pResult, void *param, int32_t code) {
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRequest
->
code
=
code
;
taosMemoryFreeClear
(
pResultInfo
->
pData
);
pRequest
->
body
.
fetchFp
(
pRequest
->
body
.
param
,
pRequest
,
0
);
return
;
}
if
(
pRequest
->
code
!=
TSDB_CODE_SUCCESS
)
{
taosMemoryFreeClear
(
pResultInfo
->
pData
);
pRequest
->
body
.
fetchFp
(
pRequest
->
body
.
param
,
pRequest
,
0
);
return
;
}
...
...
source/client/src/clientRawBlockWrite.c
浏览文件 @
4fd0bc40
...
...
@@ -701,6 +701,12 @@ typedef struct SVgroupCreateTableBatch {
static
void
destroyCreateTbReqBatch
(
void
*
data
)
{
SVgroupCreateTableBatch
*
pTbBatch
=
(
SVgroupCreateTableBatch
*
)
data
;
size_t
size
=
taosArrayGetSize
(
pTbBatch
->
req
.
pArray
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SVCreateTbReq
*
pTableReq
=
taosArrayGet
(
pTbBatch
->
req
.
pArray
,
i
);
tdDestroySVCreateTbReq
(
pTableReq
);
}
taosArrayDestroy
(
pTbBatch
->
req
.
pArray
);
}
...
...
source/common/src/tmsg.c
浏览文件 @
4fd0bc40
...
...
@@ -5436,6 +5436,8 @@ void tFreeSSubmitRsp(SSubmitRsp *pRsp) {
for
(
int32_t
i
=
0
;
i
<
pRsp
->
nBlocks
;
++
i
)
{
SSubmitBlkRsp
*
sRsp
=
pRsp
->
pBlocks
+
i
;
taosMemoryFree
(
sRsp
->
tblFName
);
tFreeSTableMetaRsp
(
sRsp
->
pMeta
);
taosMemoryFree
(
sRsp
->
pMeta
);
}
taosMemoryFree
(
pRsp
->
pBlocks
);
...
...
source/libs/catalog/src/ctgUtil.c
浏览文件 @
4fd0bc40
...
...
@@ -99,7 +99,16 @@ char *ctgTaskTypeStr(CTG_TASK_TYPE type) {
}
void
ctgFreeQNode
(
SCtgQNode
*
node
)
{
//TODO
if
(
NULL
==
node
)
{
return
;
}
if
(
node
->
op
)
{
taosMemoryFree
(
node
->
op
->
data
);
taosMemoryFree
(
node
->
op
);
}
taosMemoryFree
(
node
);
}
void
ctgFreeSTableIndex
(
void
*
info
)
{
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
4fd0bc40
...
...
@@ -5922,12 +5922,6 @@ typedef struct SVgroupCreateTableBatch {
char
dbName
[
TSDB_DB_NAME_LEN
];
}
SVgroupCreateTableBatch
;
static
void
destroyCreateTbReq
(
SVCreateTbReq
*
pReq
)
{
taosMemoryFreeClear
(
pReq
->
name
);
taosMemoryFreeClear
(
pReq
->
comment
);
taosMemoryFreeClear
(
pReq
->
ntb
.
schemaRow
.
pSchema
);
}
static
int32_t
buildNormalTableBatchReq
(
int32_t
acctId
,
const
SCreateTableStmt
*
pStmt
,
const
SVgroupInfo
*
pVgroupInfo
,
SVgroupCreateTableBatch
*
pBatch
)
{
char
dbFName
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
...
...
@@ -5942,7 +5936,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
if
(
pStmt
->
pOptions
->
commentNull
==
false
)
{
req
.
comment
=
strdup
(
pStmt
->
pOptions
->
comment
);
if
(
NULL
==
req
.
comment
)
{
destroy
CreateTbReq
(
&
req
);
tdDestroySV
CreateTbReq
(
&
req
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
req
.
commentLen
=
strlen
(
pStmt
->
pOptions
->
comment
);
...
...
@@ -5953,7 +5947,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
req
.
ntb
.
schemaRow
.
version
=
1
;
req
.
ntb
.
schemaRow
.
pSchema
=
taosMemoryCalloc
(
req
.
ntb
.
schemaRow
.
nCols
,
sizeof
(
SSchema
));
if
(
NULL
==
req
.
name
||
NULL
==
req
.
ntb
.
schemaRow
.
pSchema
)
{
destroy
CreateTbReq
(
&
req
);
tdDestroySV
CreateTbReq
(
&
req
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
if
(
pStmt
->
ignoreExists
)
{
...
...
@@ -5969,7 +5963,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
strcpy
(
pBatch
->
dbName
,
pStmt
->
dbName
);
pBatch
->
req
.
pArray
=
taosArrayInit
(
1
,
sizeof
(
struct
SVCreateTbReq
));
if
(
NULL
==
pBatch
->
req
.
pArray
)
{
destroy
CreateTbReq
(
&
req
);
tdDestroySV
CreateTbReq
(
&
req
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
taosArrayPush
(
pBatch
->
req
.
pArray
,
&
req
);
...
...
@@ -6014,16 +6008,7 @@ static void destroyCreateTbReqBatch(void* data) {
size_t
size
=
taosArrayGetSize
(
pTbBatch
->
req
.
pArray
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SVCreateTbReq
*
pTableReq
=
taosArrayGet
(
pTbBatch
->
req
.
pArray
,
i
);
taosMemoryFreeClear
(
pTableReq
->
name
);
taosMemoryFreeClear
(
pTableReq
->
comment
);
if
(
pTableReq
->
type
==
TSDB_NORMAL_TABLE
)
{
taosMemoryFreeClear
(
pTableReq
->
ntb
.
schemaRow
.
pSchema
);
}
else
if
(
pTableReq
->
type
==
TSDB_CHILD_TABLE
)
{
taosMemoryFreeClear
(
pTableReq
->
ctb
.
pTag
);
taosMemoryFreeClear
(
pTableReq
->
ctb
.
name
);
taosArrayDestroy
(
pTableReq
->
ctb
.
tagName
);
}
tdDestroySVCreateTbReq
(
pTableReq
);
}
taosArrayDestroy
(
pTbBatch
->
req
.
pArray
);
...
...
@@ -6384,6 +6369,8 @@ static int32_t rewriteCreateSubTable(STranslateContext* pCxt, SCreateSubTableCla
if
(
TSDB_CODE_SUCCESS
==
code
)
{
addCreateTbReqIntoVgroup
(
pCxt
->
pParseCxt
->
acctId
,
pVgroupHashmap
,
pStmt
,
pTag
,
pSuperTableMeta
->
uid
,
pStmt
->
useTableName
,
&
info
,
tagName
,
pSuperTableMeta
->
tableInfo
.
numOfTags
);
}
else
{
taosMemoryFree
(
pTag
);
}
taosArrayDestroy
(
tagName
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录