postgresql/src
Tom Lane b89ad383da Fix two violations of the ResourceOwnerEnlarge/Remember protocol.
The point of having separate ResourceOwnerEnlargeFoo and
ResourceOwnerRememberFoo functions is so that resource allocation
can happen in between.  Doing it in some other order is just wrong.

OpenTemporaryFile() did open(), enlarge, remember, which would leak the
open file if the enlarge step ran out of memory.  Because fd.c has its own
layer of resource-remembering, the consequences look like they'd be limited
to an intratransaction FD leak, but it's still not good.

IncrBufferRefCount() did enlarge, remember, incr-refcount, which would blow
up if the incr-refcount step ever failed.  It was safe enough when written,
but since the introduction of PrivateRefCountHash, I think the assumption
that no error could happen there is pretty shaky.

The odds of real problems from either bug are probably small, but still,
back-patch to supported branches.

Thomas Munro and Tom Lane, per a comment from Andres Freund
2017-11-08 16:50:13 -05:00
..
backend Fix two violations of the ResourceOwnerEnlarge/Remember protocol. 2017-11-08 16:50:13 -05:00
bin Translation updates 2017-11-05 17:01:24 -05:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Restore psql's SIGPIPE setting if popen() fails. 2016-12-07 12:39:24 -05:00
include Stamp 9.6.6. 2017-11-06 17:08:55 -05:00
interfaces Fix unportable usage of <ctype.h> functions. 2017-11-07 13:49:54 -05:00
makefiles Always use -fPIC, not -fpic, when building shared libraries with gcc. 2017-06-01 13:32:56 -04:00
pl Translation updates 2017-08-28 10:17:39 -04:00
port Stamp 9.6.6. 2017-11-06 17:08:55 -05:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Make json{b}_populate_recordset() use the right tuple descriptor. 2017-11-06 10:29:39 -05:00
timezone Update time zone data files to tzdata release 2017c. 2017-10-23 18:15:47 -04:00
tools Improve gendef.pl diagnostic on failure to open sym file 2017-10-26 10:10:37 -04:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in PL/Perl portability fix: absorb relevant -D switches from Perl. 2017-07-31 12:38:35 -04:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:34:15 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00