From 4db7eaae0f1aca8503f8a638a2775c1a3e0a17bb Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Tue, 30 Dec 2014 19:59:26 +0900 Subject: [PATCH] Fix resource leak pointed out by Coverity. --- contrib/pgbench/pgbench.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index d87e75c770..2111f16f35 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; } -- 2.40.0