Skip to content

Commit 3b5a89c

Browse files
committed
Fix resource leak pointed out by Coverity.
1 parent ae17897 commit 3b5a89c

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
@@ -2134,6 +2134,7 @@ parseQuery(Command *cmd, const char *raw_sql)
21342134
if (cmd->argc >= MAX_ARGS)
21352135
{
21362136
fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
2137+
pg_free(name);
21372138
return false;
21382139
}
21392140

@@ -2410,6 +2411,7 @@ process_file(char *filename)
24102411
else if ((fd = fopen(filename, "r")) == NULL)
24112412
{
24122413
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
2414+
pg_free(my_commands);
24132415
return false;
24142416
}
24152417

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