Fix incorrect logic in plpgsql for cleanup after evaluation of non-simple

Tom Lane <tgl@sss.pgh.pa.us>

Commit: ef2b138b89d9ce83c1153e22ec6b07e2a76728b1
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-08-09T18:51:12Z
Releases: 7.4.30
Fix incorrect logic in plpgsql for cleanup after evaluation of non-simple
expressions.  We need to deal with this when handling subscripts in an array
assignment, and also when catching an exception.  In an Assert-enabled build
these omissions led to Assert failures, but I think in a normal build the
only consequence would be short-term memory leakage; which may explain why
this wasn't reported from the field long ago.

Back-patch to all supported versions.  7.4 doesn't have exceptions, but
otherwise these bugs go all the way back.

Heikki Linnakangas and Tom Lane

Files