Skip to content

Commit

Permalink
fix: local variable array make windows stackoverflow (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
sangshuduo committed Mar 6, 2023
1 parent 14df5bc commit a9614af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/benchJsonOpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,8 +1372,7 @@ static int getMetaFromQueryJsonFile(tools_cJSON *json) {
sqlFileObj->valuestring);
goto PARSE_OVER;
}
char buf[TSDB_MAX_ALLOWED_SQL_LEN];
memset(buf, 0, TSDB_MAX_ALLOWED_SQL_LEN);
char *buf = benchCalloc(1, TSDB_MAX_ALLOWED_SQL_LEN, true);
while (fgets(buf, TSDB_MAX_ALLOWED_SQL_LEN, fp)) {
SSQL * sql = benchCalloc(1, sizeof(SSQL), true);
benchArrayPush(g_queryInfo.specifiedQueryInfo.sqls, sql);
Expand All @@ -1389,6 +1388,7 @@ static int getMetaFromQueryJsonFile(tools_cJSON *json) {
debugPrint("read file buffer: %s\n", sql->command);
memset(buf, 0, TSDB_MAX_ALLOWED_SQL_LEN);
}
free(buf);
fclose(fp);
}
// sqls
Expand Down

0 comments on commit a9614af

Please sign in to comment.