postgresql/src
Tom Lane 5b668ac7be Fix refcounting bug in PLy_modify_tuple().
We must increment the refcount on "plntup" as soon as we have the
reference, not sometime later.  Otherwise, if an error is thrown in
between, the Py_XDECREF(plntup) call in the PG_CATCH block removes a
refcount we didn't add, allowing the object to be freed even though
it's still part of the plpython function's parsetree.

This appears to be the cause of crashes seen on buildfarm member
prairiedog.  It's a bit surprising that we've not seen it fail repeatably
before, considering that the regression tests have been exercising the
faulty code path since 2009.

The real-world impact is probably minimal, since it's unlikely anyone would
be provoking the "TD["new"] is not a dictionary" error in production, and
that's the only case that is actually wrong.  Still, it's a bug affecting
the regression tests, so patch all supported branches.

In passing, remove dead variable "plstr", and demote "platt" to a local
variable inside the PG_TRY block, since we don't need to clean it up
in the PG_CATCH path.
2014-03-26 16:41:44 -04:00
..
backend Don't forget to flush XLOG_PARAMETER_CHANGE record. 2014-03-26 02:38:14 +09:00
bin Properly check for readdir/closedir() failures 2014-03-21 13:45:11 -04:00
include Stamp 9.0.17. 2014-03-17 15:38:14 -04:00
interfaces Stamp 9.0.17. 2014-03-17 15:38:14 -04:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:14:15 -05:00
pl Fix refcounting bug in PLy_modify_tuple(). 2014-03-26 16:41:44 -04:00
port Properly check for readdir/closedir() failures 2014-03-21 13:45:11 -04:00
template
test Prevent potential overruns of fixed-size buffers. 2014-02-17 11:20:35 -05:00
timezone Update time zone data files to tzdata release 2014a. 2014-03-15 13:36:49 -04:00
tools Disable RandomizeBaseAddress on MSVC builds 2014-03-16 11:47:37 +01:00
tutorial
.gitignore
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib fix whitespace 2014-02-01 16:26:31 -05:00
nls-global.mk
win32.mak