We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b6bd96 commit 1cf5445Copy full SHA for 1cf5445
stdlib/public/SwiftShims/FoundationOverlayShims.h
@@ -45,10 +45,12 @@ static inline _Bool _resizeConditionalAllocationBuffer(_ConditionalAllocationBuf
45
void *newMemory;
46
if (buffer->onStack) {
47
newMemory = malloc(amount);
48
+ if (newMemory == NULL) { return false; }
49
memcpy(newMemory, buffer->memory, buffer->capacity);
50
buffer->onStack = false;
51
} else {
52
newMemory = realloc(buffer->memory, amount);
53
54
}
55
if (newMemory == NULL) { return false; }
56
buffer->memory = newMemory;
0 commit comments