Skip to content

Commit 4db7eaa

Browse files
committed
Fix resource leak pointed out by Coverity.
1 parent 67dc4b5 commit 4db7eaa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/pgbench/pgbench.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,7 @@ parseQuery(Command *cmd, const char *raw_sql)
14731473

14741474
if (cmd->argc >= MAX_ARGS)
14751475
{
1476+
free(name);
14761477
fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
14771478
return false;
14781479
}
@@ -1670,6 +1671,7 @@ process_file(char *filename)
16701671
fd = stdin;
16711672
else if ((fd = fopen(filename, "r")) == NULL)
16721673
{
1674+
free(my_commands);
16731675
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
16741676
return false;
16751677
}

0 commit comments

Comments
 (0)