summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2014-12-30 19:48:53 +0900
committerTatsuo Ishii <ishii@postgresql.org>2014-12-30 19:48:53 +0900
commit4c136b0b6389ce24838cc78eda5d213c15ac93fe (patch)
treef639ea7521f5475b377ea63618b2bd87b4e0e47d
parent30c71f30a983aced1a20168182c32d2f092c7fcd (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 0384231083b..97dcad0ce64 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1386,6 +1386,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);
+ free(name);
return false;
}
@@ -1582,6 +1583,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;
}