mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:08:12 +00:00
Kernel: Replace make<T>() with adopt_own_if_nonnull() in KBufferBuilder
The make<T> factory function allocates internally and immediately dereferences the pointer, and always returns a NonnullOwnPtr<T> making it impossible to propagate an error on OOM.
This commit is contained in:
parent
fb40da0429
commit
9ca8f0afaa
1 changed files with 2 additions and 1 deletions
|
@ -38,7 +38,8 @@ OwnPtr<KBuffer> KBufferBuilder::build()
|
|||
{
|
||||
if (!flush())
|
||||
return {};
|
||||
return make<KBuffer>(move(m_buffer));
|
||||
|
||||
return adopt_own_if_nonnull(new KBuffer(move(m_buffer)));
|
||||
}
|
||||
|
||||
KBufferBuilder::KBufferBuilder(bool can_expand)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue