postgresql/src/backend
Tom Lane c5269472ea 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:12 -05:00
..
access Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
bootstrap Exclude flex-generated code from coverage testing 2017-10-16 16:28:11 -04:00
catalog Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
commands Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
executor Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
foreign Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
lib Allow to avoid NUL-byte management for stringinfos and use in format.c. 2017-10-11 16:01:52 -07:00
libpq Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
main Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
nodes Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
optimizer Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
parser Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Fix incorrect use of bool 2017-11-04 12:00:58 -04:00
postmaster Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
regex Mop-up for commit 85feb77aa0. 2017-09-22 11:35:12 -04:00
replication Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
rewrite Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Infer functional dependency past RelabelType 2017-10-12 17:23:47 +02:00
storage Fix two violations of the ResourceOwnerEnlarge/Remember protocol. 2017-11-08 16:50:12 -05:00
tcop Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
tsearch Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
utils Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile Inject $(ICU_LIBS) regardless of platform. 2017-08-20 21:22:18 -07:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00