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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to