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:
parent
be613b9ef6
commit
300402cc14
Notes:
sideshowbarker
2024-07-18 04:31:11 +09:00
Author: https://github.com/awesomekling
Commit: 300402cc14
9 changed files with 30 additions and 13 deletions
|
@ -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()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue