1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

Kernel: Make it possible for KBufferBuilder creation to fail

This patch adds KBufferBuilder::try_create() and treats it like anything
else that can fail. And so, failure to allocate the initial internal
buffer of the builder will now propagate an ENOMEM to the caller. :^)
This commit is contained in:
Andreas Kling 2021-09-07 15:54:23 +02:00
parent be613b9ef6
commit 300402cc14
Notes: sideshowbarker 2024-07-18 04:31:11 +09:00
9 changed files with 30 additions and 13 deletions

View file

@ -281,7 +281,7 @@ KResult Coredump::write()
SpinlockLocker lock(m_process->address_space().get_lock());
ScopedAddressSpaceSwitcher switcher(m_process);
KBufferBuilder builder;
auto builder = TRY(KBufferBuilder::try_create());
TRY(create_notes_segment_data(builder));
TRY(write_elf_header());
TRY(write_program_headers(builder.bytes().size()));