]> granicus.if.org Git - postgresql/commit
Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variables.
authorNoah Misch <noah@leadboat.com>
Thu, 26 Feb 2015 04:48:28 +0000 (23:48 -0500)
committerNoah Misch <noah@leadboat.com>
Thu, 26 Feb 2015 04:48:28 +0000 (23:48 -0500)
commitf5ef00aed4c39645716cabb2e4cf1ef3598fcde7
tree508d8bfd472cb06772338395101758745a3a5993
parent62a4a1af5d1d84f0023bc3816c204191b0f4f49f
Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variables.

"RETURN SQLERRM" prompted plpgsql_exec_function() to read from freed
memory.  Back-patch to 9.0 (all supported versions).  Little code ran
between the premature free and the read, so non-assert builds are
unlikely to witness user-visible consequences.
src/pl/plpgsql/src/pl_exec.c
src/test/regress/expected/plpgsql.out
src/test/regress/sql/plpgsql.sql