Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variables.

Noah Misch <noah@leadboat.com>

Commit: 4651e37cb1c9cc34643921bdc8b783d1c81b488f
Author: Noah Misch <noah@leadboat.com>
Date: 2015-02-26T04:48:54Z
Releases: 9.3.7
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.

Files