1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Fix resource leak pointed out by Coverity.

This commit is contained in:
Tatsuo Ishii
2014-12-30 19:59:26 +09:00
parent 67dc4b5c30
commit 4db7eaae0f

View File

@ -1473,6 +1473,7 @@ parseQuery(Command *cmd, const char *raw_sql)
if (cmd->argc >= MAX_ARGS)
{
free(name);
fprintf(stderr, "statement has too many arguments (maximum is %d): %s\n", MAX_ARGS - 1, raw_sql);
return false;
}
@ -1670,6 +1671,7 @@ process_file(char *filename)
fd = stdin;
else if ((fd = fopen(filename, "r")) == NULL)
{
free(my_commands);
fprintf(stderr, "%s: %s\n", filename, strerror(errno));
return false;
}