Skip to content

Commit 4c136b0

Browse files
committed
Fix resource leak pointed out by Coverity.
1 parent 30c71f3 commit 4c136b0

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
@@ -1386,6 +1386,7 @@ parseQuery(Command *cmd, const char *raw_sql)
13861386
if (cmd->argc >= MAX_ARGS)
13871387
{
13881388
fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
1389+
free(name);
13891390
return false;
13901391
}
13911392

@@ -1582,6 +1583,7 @@ process_file(char *filename)
15821583
fd = stdin;
15831584
else if ((fd = fopen(filename, "r")) == NULL)
15841585
{
1586+
free(my_commands);
15851587
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
15861588
return false;
15871589
}

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