postgresql/src
Tom Lane a6f7745a3e Fix plancache refcount leak after error in ExecuteQuery.
When stuffing a plan from the plancache into a Portal, one is
not supposed to risk throwing an error between GetCachedPlan and
PortalDefineQuery; if that happens, the plan refcount incremented
by GetCachedPlan will be leaked.  I managed to break this rule
while refactoring code in 9dbf2b7d7.  There is no visible
consequence other than some memory leakage, and since nobody is
very likely to trigger the relevant error conditions many times
in a row, it's not surprising we haven't noticed.  Nonetheless,
it's a bug, so rearrange the order of operations to remove the
hazard.

Noted on the way to looking for a better fix for bug #17053.
This mistake is pretty old, so back-patch to all supported
branches.
2021-06-16 19:30:17 -04:00
..
backend Fix plancache refcount leak after error in ExecuteQuery. 2021-06-16 19:30:17 -04:00
bin Work around portability issue with newer versions of mktime(). 2021-06-13 14:32:42 -04:00
common Replace use of sys_siglist[] with strsignal(). 2020-07-15 22:05:12 -04:00
fe_utils Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
include Fix decoding of speculative aborts. 2021-06-15 09:10:24 +05:30
interfaces Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:36 -04:00
pl Port regress-python3-mangle.mk to Solaris "sed". 2021-04-12 19:24:25 -07:00
port Support use of strnlen() in pre-v11 branches. 2021-06-07 13:12:35 -04:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:46 -05:00
test Further refinement of stuck_on_old_timeline recovery test 2021-06-15 15:37:15 -04:00
timezone Update time zone data files to tzdata release 2021a. 2021-01-24 16:29:48 -05:00
tools fix syntax error 2021-05-28 09:35:55 -04:00
tutorial tutorial: land height is "elevation", not "altitude" 2021-03-10 20:25:18 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS
Makefile Build src/test/isolation during "make" and "make install". 2017-11-22 20:18:52 -08:00
Makefile.global.in Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:36 -04:00
Makefile.shlib makefile: use proper linker flags for C++ compiles 2020-03-31 22:26:11 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00