Re: BUG #15541: Use after release in PQprint - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15541: Use after release in PQprint
Date
Msg-id 15915.1544205176@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15541: Use after release in PQprint  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15541: Use after release in PQprint  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> The function PQprint releases the file hander fout via pclose or _pclose
> when usePipe is true. After that, fout is used again to write message
> "fputs("</table>\n", fout);".

Wow, that is ancient.  It looks like commit edb519b14 of 27-Jul-1996
added the pipe close stanza in the wrong place, and nobody's noticed
it since.  That's probably not so surprising given the multiple
conditions required to trigger it plus the fact that this whole
function is, if not completely dead code, at least not used anywhere
in the PG distribution.  Still, we oughta fix it.

Thanks for the report!

            regards, tom lane


pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #15540: Use after release in ExecuteTruncateGuts
Next
From: Tom Lane
Date:
Subject: Re: BUG #15541: Use after release in PQprint