From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Euler Taveira de Oliveira <euler(at)timbira(dot)com> |
Cc: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, meskes(at)postgresql(dot)org |
Subject: | Re: another ecpg crash |
Date: | 2008-05-11 04:52:51 |
Message-ID: | 20080511045251.GD9136@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Euler Taveira de Oliveira | 2008-05-11 05:19:05 | Re: another ecpg crash |
Previous Message | Euler Taveira de Oliveira | 2008-05-11 04:50:22 | another ecpg crash |