]> 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:49 +0000 (23:48 -0500)
commit38930e473a799c1ba2b33b2964dd2b9f8862a268
tree1d945435c28d38957f9cac6395a8a52392a50e3c
parentf16270aded0af5f3b19719bee3f67c8cc19b20aa
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