Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita05cf22

Browse files
committed
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 mallocfailure right here, the code would act as though MCXT_ALLOC_NO_OOMhad been specified, whether it was or not. That would likely leadto a null-pointer-dereference crash at the unsuspecting call site.Noted while messing with a patch to improve our Valgrind leakdetection support. Back-patch to v17 where this code came in.
1 parent3007fee commita05cf22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/utils/mmgr/bump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ BumpAllocLarge(MemoryContext context, Size size, int flags)
316316

317317
block= (BumpBlock*)malloc(blksize);
318318
if (block==NULL)
319-
returnNULL;
319+
returnMemoryContextAllocationFailure(context,size,flags);
320320

321321
context->mem_allocated+=blksize;
322322

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp