Fix resource leak pointed out by Coverity.

This commit is contained in:
Tatsuo Ishii 2014-12-30 19:48:53 +09:00
parent 30c71f30a9
commit 4c136b0b63

View File

@ -1386,6 +1386,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);
free(name);
return false;
}
@ -1582,6 +1583,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;
}