diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 7f8818df7e7ea9e33a9f21e2b8071d8ade6d9363..2d42cc0b56ec47390f7d416bed9e35310e4779c2 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -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;