]> git.ipfire.org Git - thirdparty/postgresql.git/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:40:13 +0000 (23:40 -0500)
commit80c925c7b4efcd80a8c648ca94ba1fabbd2863ae
tree8514a2cab54157fd6385cf9c55a3228d028fb906
parentf6a605702aa15f7a49da1ec0ab60a8abd956c139
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