aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/commit.sgml
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-05-23 11:47:33 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-05-23 11:47:33 -0400
commit6aa33afe6da1ce5e6a9c68900727db4621f899cd (patch)
tree2c6293926130067deb52cb3ff5408e06c94bbdb8 /doc/src/sgml/ref/commit.sgml
parentfb844b9f06568aa29303122ac0bb7b4c3cce2542 (diff)
downloadpostgresql-6aa33afe6da1ce5e6a9c68900727db4621f899cd.tar.gz
postgresql-6aa33afe6da1ce5e6a9c68900727db4621f899cd.zip
Fix AlignedAllocRealloc to cope sanely with OOM.
If the inner allocation call returns NULL, we should restore the previous state and return NULL. Previously this code pfree'd the old chunk anyway, which is surely wrong. Also, make it call MemoryContextAllocationFailure rather than summarily returning NULL. The fact that we got control back from the inner call proves that MCXT_ALLOC_NO_OOM was passed, so this change is just cosmetic, but someday it might be less so. This is just a latent bug at present: AFAICT no in-core callers use this function at all, let alone call it with MCXT_ALLOC_NO_OOM. Still, it's the kind of bug that might bite back-patched code pretty hard someday, so let's back-patch to v17 where the bug was introduced (by commit 743112a2e). Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/285483.1746756246@sss.pgh.pa.us Backpatch-through: 17
Diffstat (limited to 'doc/src/sgml/ref/commit.sgml')
0 files changed, 0 insertions, 0 deletions