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:27:26 +0900
commit458e8bc653ab7f25de432762c89272540abfeaeb (patch)
tree2f805324839a38e546899b14a166cbff46d7f48c
parent1f35d93843108680e51a35424591c28fc3fbe5fe (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 ed7fc1946eb..c080c466915 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1929,6 +1929,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;
}
@@ -2169,6 +2170,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;
}