]> granicus.if.org Git - postgresql/commitdiff
Fix resource leak pointed out by Coverity.
authorTatsuo Ishii <ishii@postgresql.org>
Tue, 30 Dec 2014 11:19:50 +0000 (20:19 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Tue, 30 Dec 2014 11:27:26 +0000 (20:27 +0900)
contrib/pgbench/pgbench.c

index ed7fc1946ebd62adb0848dbec05e9c23cae2a012..c080c4669154df92879d83eae4e387532892ff63 100644 (file)
@@ -1929,6 +1929,7 @@ parseQuery(Command *cmd, const char *raw_sql)
                if (cmd->argc >= MAX_ARGS)
                {
                        fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
+                       pg_free(name);
                        return false;
                }
 
@@ -2169,6 +2170,7 @@ process_file(char *filename)
        else if ((fd = fopen(filename, "r")) == NULL)
        {
                fprintf(stderr, "%s: %s\n", filename, strerror(errno));
+               pg_free(my_commands);
                return false;
        }