Re: Problem with setlocale (found in libecpg) [accessing a memory location after freeing it]

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Meskes <meskes@postgresql.org>
Cc: Christof Petig <christof@petig-baender.de>, pgsql-patches@postgresql.org
Date: 2001-09-29T20:15:01Z
Lists: pgsql-hackers
Michael Meskes <meskes@postgresql.org> writes:
> You're partially right. Standard says "This  string  may  be allocated  in
> static storage." So, yes, with your patch we are on the safe side. I just
> committed the changes.

This patch wasn't right: setlocale(LC_NUMERIC, "C") returns a string
corresponding to the *new* locale setting, not the old one.  Therefore,
while the patched code failed to dump core, it also failed to restore
the previous locale setting as intended.  I have committed an updated
version.

			regards, tom lane