Fix incorrect "return NULL" in BumpAllocLarge().

Tom Lane <tgl@sss.pgh.pa.us>

Commit: a05cf22e0540e55fb34e26e6e98a8a76b76d1cbd
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2025-05-11T00:22:39Z
Releases: 17.6
Fix incorrect "return NULL" in BumpAllocLarge().

This must be "return MemoryContextAllocationFailure(context, size, flags)"
instead.  The effect of this oversight is that if we got a malloc
failure right here, the code would act as though MCXT_ALLOC_NO_OOM
had been specified, whether it was or not.  That would likely lead
to a null-pointer-dereference crash at the unsuspecting call site.

Noted while messing with a patch to improve our Valgrind leak
detection support.  Back-patch to v17 where this code came in.

Files

PathChange+/−
src/backend/utils/mmgr/bump.c modified +1 −1