Skip to content

Commit 458e8bc

Browse files
committed
Fix resource leak pointed out by Coverity.
1 parent 1f35d93 commit 458e8bc

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
@@ -1929,6 +1929,7 @@ parseQuery(Command *cmd, const char *raw_sql)
19291929
if (cmd->argc >= MAX_ARGS)
19301930
{
19311931
fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
1932+
pg_free(name);
19321933
return false;
19331934
}
19341935

@@ -2169,6 +2170,7 @@ process_file(char *filename)
21692170
else if ((fd = fopen(filename, "r")) == NULL)
21702171
{
21712172
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
2173+
pg_free(my_commands);
21722174
return false;
21732175
}
21742176

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