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: Shuduo Sang <sdsang@taosdata.com>
This commit is contained in:
parent
93b9371ee8
commit
4cc087ecb0
|
@ -4702,14 +4702,18 @@ PARSE_OVER:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void prepareSampleData() {
|
||||
static int prepareSampleData() {
|
||||
for (int i = 0; i < g_Dbs.dbCount; i++) {
|
||||
for (int j = 0; j < g_Dbs.db[i].superTblCount; j++) {
|
||||
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() {
|
||||
|
@ -6771,7 +6775,11 @@ static int insertTestProcess() {
|
|||
}
|
||||
|
||||
// pretreatement
|
||||
prepareSampleData();
|
||||
if (prepareSampleData() != 0) {
|
||||
if (g_fpOfInsertResult)
|
||||
fclose(g_fpOfInsertResult);
|
||||
return -1;
|
||||
}
|
||||
|
||||
double start;
|
||||
double end;
|
||||
|
|
Loading…
Reference in New Issue