未验证 提交 4cc087ec 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

Hotfix/sangshuduo/td 3197 taosdemo coverity scan for master (#6725)

* [TD-3197]<fix>: taosdemo and taosdump coverity scan issues.

* exit if read sample file failed.
Co-authored-by: NShuduo Sang <sdsang@taosdata.com>
上级 93b9371e
...@@ -4702,14 +4702,18 @@ PARSE_OVER: ...@@ -4702,14 +4702,18 @@ PARSE_OVER:
return ret; return ret;
} }
static void prepareSampleData() { static int prepareSampleData() {
for (int i = 0; i < g_Dbs.dbCount; i++) { for (int i = 0; i < g_Dbs.dbCount; i++) {
for (int j = 0; j < g_Dbs.db[i].superTblCount; j++) { for (int j = 0; j < g_Dbs.db[i].superTblCount; j++) {
if (g_Dbs.db[i].superTbls[j].tagsFile[0] != 0) { if (g_Dbs.db[i].superTbls[j].tagsFile[0] != 0) {
(void)readTagFromCsvFileToMem(&g_Dbs.db[i].superTbls[j]); if (readTagFromCsvFileToMem(&g_Dbs.db[i].superTbls[j]) != 0) {
return -1;
}
} }
} }
} }
return 0;
} }
static void postFreeResource() { static void postFreeResource() {
...@@ -6771,7 +6775,11 @@ static int insertTestProcess() { ...@@ -6771,7 +6775,11 @@ static int insertTestProcess() {
} }
// pretreatement // pretreatement
prepareSampleData(); if (prepareSampleData() != 0) {
if (g_fpOfInsertResult)
fclose(g_fpOfInsertResult);
return -1;
}
double start; double start;
double end; double end;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册