]> 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:49:45 +0000 (23:49 -0500)
commit40a9a16760ab803694583d7f3549a7ad7bc11d75
tree810a8829339b3185b18caf191f7390e6d5075325
parent7a501bcbfc64d9e66fa6e83ed57b1804203da3e3
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