]> granicus.if.org Git - postgresql/commit
Avoid multiple free_struct_lconv() calls on same data.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 29 Feb 2016 04:39:20 +0000 (23:39 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 29 Feb 2016 04:39:20 +0000 (23:39 -0500)
commit907e4dd2b104bdcb4af042065a92fcd73d5790ec
treef70374343df08a578e31b61e3915d773ab870e94
parent26fdff1b8f76f3c47d4e19be7c4aef3cdcd3393c
Avoid multiple free_struct_lconv() calls on same data.

A failure partway through PGLC_localeconv() led to a situation where
the next call would call free_struct_lconv() a second time, leading
to free() on already-freed strings, typically leading to a core dump.
Add a flag to remember whether we need to do that.

Per report from Thom Brown.  His example case only provokes the failure
as far back as 9.4, but nonetheless this code is obviously broken, so
back-patch to all supported branches.
src/backend/utils/adt/pg_locale.c