diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index d87e75c7702f72bc4a9dbad53685f1b04c886e17..2111f16f3587da0435fc5a21c1dee750e0e39393 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -1473,6 +1473,7 @@ parseQuery(Command *cmd, const char *raw_sql) if (cmd->argc >= MAX_ARGS) { + free(name); fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql); return false; } @@ -1670,6 +1671,7 @@ process_file(char *filename) fd = stdin; else if ((fd = fopen(filename, "r")) == NULL) { + free(my_commands); fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return false; }