summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2014-12-30 20:19:50 +0900
committerTatsuo Ishii <ishii@postgresql.org>2014-12-30 20:20:56 +0900
commited0e03283579eb6c79be7c98f050cf6c447a9986 (patch)
tree8e9c31ae36c286e1b51764b935f8c800821eb4d7
parentb1cbb26f116814fa3642178bb2c62a3654870f75 (diff)
Fix resource leak pointed out by Coverity.
-rw-r--r--contrib/pgbench/pgbench.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 56afd44d786..dbafd60990c 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1745,6 +1745,7 @@ parseQuery(Command *cmd, const char *raw_sql)
if (cmd->argc >= MAX_ARGS)
{
fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
+ pg_free(name);
return false;
}
@@ -1942,6 +1943,7 @@ process_file(char *filename)
else if ((fd = fopen(filename, "r")) == NULL)
{
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
+ pg_free(my_commands);
return false;
}