Re: another ecpg crash
| От | Alvaro Herrera |
|---|---|
| Тема | Re: another ecpg crash |
| Дата | |
| Msg-id | 20080511045251.GD9136@alvh.no-ip.org обсуждение исходный текст |
| Ответ на | another ecpg crash (Euler Taveira de Oliveira <euler@timbira.com>) |
| Ответы |
Re: another ecpg crash
|
| Список | pgsql-hackers |
Euler Taveira de Oliveira wrote:
> Hi,
>
> I found another bug when using 'exec sql include filename'. If you use a
> filename that doesn't exist, ecpg crashes while trying to close a null
> pointer. The above test case shows it. A possible fix is attached.
Huh, isn't the test backwards?
> --- 90,98 ----
> ret_value = error_code;
> break;
> case ET_FATAL:
> ! /* there are some cases (i.e. file not found) that the input is not available */
> ! if (!yyin)
> ! fclose(yyin);
> fclose(yyout);
> if (unlink(output_filename) != 0 && *output_filename != '-')
> fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
В списке pgsql-hackers по дате отправления: