Skip to content

Commit ed0e032

Browse files
committed
Fix resource leak pointed out by Coverity.
1 parent b1cbb26 commit ed0e032

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
@@ -1745,6 +1745,7 @@ parseQuery(Command *cmd, const char *raw_sql)
17451745
if (cmd->argc >= MAX_ARGS)
17461746
{
17471747
fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
1748+
pg_free(name);
17481749
return false;
17491750
}
17501751

@@ -1942,6 +1943,7 @@ process_file(char *filename)
19421943
else if ((fd = fopen(filename, "r")) == NULL)
19431944
{
19441945
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
1946+
pg_free(my_commands);
19451947
return false;
19461948
}
19471949

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy