Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
211c079b
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看板
提交
211c079b
编写于
7月 28, 2021
作者:
M
markswang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5534]<fix>:fix the coverity high risk of client
上级
4216a400
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
23 deletion
+15
-23
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+4
-11
src/client/src/tscGlobalmerge.c
src/client/src/tscGlobalmerge.c
+1
-2
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+6
-6
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+2
-2
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-1
未找到文件。
src/client/src/TSDBJNIConnector.c
浏览文件 @
211c079b
...
@@ -726,13 +726,12 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_prepareStmtImp(J
...
@@ -726,13 +726,12 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_prepareStmtImp(J
TAOS_STMT
*
pStmt
=
taos_stmt_init
(
tscon
);
TAOS_STMT
*
pStmt
=
taos_stmt_init
(
tscon
);
int32_t
code
=
taos_stmt_prepare
(
pStmt
,
str
,
len
);
int32_t
code
=
taos_stmt_prepare
(
pStmt
,
str
,
len
);
tfree
(
str
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
jniError
(
"jobj:%p, conn:%p, code:%s"
,
jobj
,
tscon
,
tstrerror
(
code
));
jniError
(
"jobj:%p, conn:%p, code:%s"
,
jobj
,
tscon
,
tstrerror
(
code
));
free
(
str
);
return
JNI_TDENGINE_ERROR
;
return
JNI_TDENGINE_ERROR
;
}
}
free
(
str
);
return
(
jlong
)
pStmt
;
return
(
jlong
)
pStmt
;
}
}
...
@@ -920,10 +919,6 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setTableNameTagsI
...
@@ -920,10 +919,6 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setTableNameTagsI
char
*
curTags
=
tagsData
;
char
*
curTags
=
tagsData
;
TAOS_BIND
*
tagsBind
=
calloc
(
numOfTags
,
sizeof
(
TAOS_BIND
));
TAOS_BIND
*
tagsBind
=
calloc
(
numOfTags
,
sizeof
(
TAOS_BIND
));
if
(
tagsBind
==
NULL
)
{
jniError
(
"numOfTags:%d, alloc memory failed"
,
numOfTags
);
return
JNI_OUT_OF_MEMORY
;
}
for
(
int32_t
i
=
0
;
i
<
numOfTags
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfTags
;
++
i
)
{
tagsBind
[
i
].
buffer_type
=
typeArray
[
i
];
tagsBind
[
i
].
buffer_type
=
typeArray
[
i
];
tagsBind
[
i
].
buffer
=
curTags
;
tagsBind
[
i
].
buffer
=
curTags
;
...
@@ -942,14 +937,13 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setTableNameTagsI
...
@@ -942,14 +937,13 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setTableNameTagsI
tfree
(
lengthArray
);
tfree
(
lengthArray
);
tfree
(
typeArray
);
tfree
(
typeArray
);
tfree
(
nullArray
);
tfree
(
nullArray
);
tfree
(
tagsBind
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
tableName
,
name
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
tableName
,
name
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
jniError
(
"jobj:%p, conn:%p, code:%s"
,
jobj
,
tsconn
,
tstrerror
(
code
));
jniError
(
"jobj:%p, conn:%p, code:%s"
,
jobj
,
tsconn
,
tstrerror
(
code
));
free
(
tagsBind
);
return
JNI_TDENGINE_ERROR
;
return
JNI_TDENGINE_ERROR
;
}
}
free
(
tagsBind
);
return
JNI_SUCCESS
;
return
JNI_SUCCESS
;
}
}
...
@@ -979,12 +973,11 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_insertLinesImp(J
...
@@ -979,12 +973,11 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_insertLinesImp(J
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
line
,
c_lines
[
i
]);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
line
,
c_lines
[
i
]);
}
}
tfree
(
c_lines
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
jniError
(
"jobj:%p, conn:%p, code:%s"
,
jobj
,
taos
,
tstrerror
(
code
));
jniError
(
"jobj:%p, conn:%p, code:%s"
,
jobj
,
taos
,
tstrerror
(
code
));
free
(
c_lines
);
return
JNI_TDENGINE_ERROR
;
return
JNI_TDENGINE_ERROR
;
}
}
free
(
c_lines
);
return
code
;
return
code
;
}
}
\ No newline at end of file
src/client/src/tscGlobalmerge.c
浏览文件 @
211c079b
...
@@ -443,11 +443,10 @@ int32_t tscCreateGlobalMergerEnv(SQueryInfo *pQueryInfo, tExtMemBuffer ***pMemBu
...
@@ -443,11 +443,10 @@ int32_t tscCreateGlobalMergerEnv(SQueryInfo *pQueryInfo, tExtMemBuffer ***pMemBu
}
}
pModel
=
createColumnModel
(
pSchema
,
(
int32_t
)
size
,
capacity
);
pModel
=
createColumnModel
(
pSchema
,
(
int32_t
)
size
,
capacity
);
tfree
(
pSchema
);
if
(
pModel
==
NULL
){
if
(
pModel
==
NULL
){
tfree
(
pSchema
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
tfree
(
pSchema
);
int32_t
pg
=
DEFAULT_PAGE_SIZE
;
int32_t
pg
=
DEFAULT_PAGE_SIZE
;
int32_t
overhead
=
sizeof
(
tFilePage
);
int32_t
overhead
=
sizeof
(
tFilePage
);
...
...
src/client/src/tscParseLineProtocol.c
浏览文件 @
211c079b
...
@@ -701,14 +701,14 @@ static int32_t insertChildTableBatch(TAOS* taos, char* cTableName, SArray* cols
...
@@ -701,14 +701,14 @@ static int32_t insertChildTableBatch(TAOS* taos, char* cTableName, SArray* cols
TAOS_STMT
*
stmt
=
taos_stmt_init
(
taos
);
TAOS_STMT
*
stmt
=
taos_stmt_init
(
taos
);
if
(
stmt
==
NULL
)
{
if
(
stmt
==
NULL
)
{
free
(
sql
);
t
free
(
sql
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
code
=
taos_stmt_prepare
(
stmt
,
sql
,
(
unsigned
long
)
strlen
(
sql
));
code
=
taos_stmt_prepare
(
stmt
,
sql
,
(
unsigned
long
)
strlen
(
sql
));
free
(
sql
);
t
free
(
sql
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
free
(
stmt
);
t
free
(
stmt
);
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
return
code
;
return
code
;
}
}
...
@@ -717,7 +717,7 @@ static int32_t insertChildTableBatch(TAOS* taos, char* cTableName, SArray* cols
...
@@ -717,7 +717,7 @@ static int32_t insertChildTableBatch(TAOS* taos, char* cTableName, SArray* cols
code
=
taos_stmt_set_tbname
(
stmt
,
cTableName
);
code
=
taos_stmt_set_tbname
(
stmt
,
cTableName
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
free
(
stmt
);
t
free
(
stmt
);
return
code
;
return
code
;
}
}
...
@@ -727,13 +727,13 @@ static int32_t insertChildTableBatch(TAOS* taos, char* cTableName, SArray* cols
...
@@ -727,13 +727,13 @@ static int32_t insertChildTableBatch(TAOS* taos, char* cTableName, SArray* cols
code
=
taos_stmt_bind_param
(
stmt
,
colsBinds
);
code
=
taos_stmt_bind_param
(
stmt
,
colsBinds
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
free
(
stmt
);
t
free
(
stmt
);
return
code
;
return
code
;
}
}
code
=
taos_stmt_add_batch
(
stmt
);
code
=
taos_stmt_add_batch
(
stmt
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
tscError
(
"%s"
,
taos_stmt_errstr
(
stmt
));
free
(
stmt
);
t
free
(
stmt
);
return
code
;
return
code
;
}
}
}
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
211c079b
...
@@ -8362,7 +8362,7 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
...
@@ -8362,7 +8362,7 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
if
(
subInfo
->
aliasName
.
n
>
0
)
{
if
(
subInfo
->
aliasName
.
n
>
0
)
{
if
(
subInfo
->
aliasName
.
n
>=
TSDB_TABLE_FNAME_LEN
)
{
if
(
subInfo
->
aliasName
.
n
>=
TSDB_TABLE_FNAME_LEN
)
{
free
(
pTableMetaInfo1
);
t
free
(
pTableMetaInfo1
);
return
invalidOperationMsg
(
msgBuf
,
"subquery alias name too long"
);
return
invalidOperationMsg
(
msgBuf
,
"subquery alias name too long"
);
}
}
...
@@ -8376,7 +8376,7 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
...
@@ -8376,7 +8376,7 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS
STableMetaInfo
**
tmp
=
realloc
(
pQueryInfo
->
pTableMetaInfo
,
(
pQueryInfo
->
numOfTables
+
1
)
*
POINTER_BYTES
);
STableMetaInfo
**
tmp
=
realloc
(
pQueryInfo
->
pTableMetaInfo
,
(
pQueryInfo
->
numOfTables
+
1
)
*
POINTER_BYTES
);
if
(
tmp
==
NULL
)
{
if
(
tmp
==
NULL
)
{
free
(
pTableMetaInfo1
);
t
free
(
pTableMetaInfo1
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
...
...
src/client/src/tscServer.c
浏览文件 @
211c079b
...
@@ -2055,7 +2055,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
...
@@ -2055,7 +2055,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
}
}
if
(
!
tIsValidSchema
(
pTableMeta
->
schema
,
pTableMeta
->
tableInfo
.
numOfColumns
,
pTableMeta
->
tableInfo
.
numOfTags
))
{
if
(
!
tIsValidSchema
(
pTableMeta
->
schema
,
pTableMeta
->
tableInfo
.
numOfColumns
,
pTableMeta
->
tableInfo
.
numOfTags
))
{
tscError
(
"0x%"
PRIx64
" invalid table meta from mnode, name:%s"
,
pSql
->
self
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
));
tscError
(
"0x%"
PRIx64
" invalid table meta from mnode, name:%s"
,
pSql
->
self
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
));
free
(
pTableMeta
);
t
free
(
pTableMeta
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
211c079b
...
@@ -2476,7 +2476,7 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
...
@@ -2476,7 +2476,7 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
pState
->
states
=
calloc
(
pState
->
numOfSub
,
sizeof
(
*
pState
->
states
));
pState
->
states
=
calloc
(
pState
->
numOfSub
,
sizeof
(
*
pState
->
states
));
if
(
pState
->
states
==
NULL
)
{
if
(
pState
->
states
==
NULL
)
{
pRes
->
code
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
pRes
->
code
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tscDestroyGlobalMergerEnv
(
pMemoryBuf
,
pDesc
,
pState
->
numOfSub
);
tscDestroyGlob
alMergerEnv
(
pMemoryBuf
,
pDesc
,
pState
->
numOfSub
);
tscAsyncResultOnError
(
pSql
);
tscAsyncResultOnError
(
pSql
);
return
ret
;
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录