mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 17:55:07 +00:00
Kernel: Harden Socket Vector usage against OOM
This commit is contained in:
parent
e8d6d478c4
commit
f0568bff9b
1 changed files with 2 additions and 1 deletions
|
@ -72,7 +72,8 @@ KResult Socket::queue_connection_from(NonnullRefPtr<Socket> peer)
|
||||||
Locker locker(m_lock);
|
Locker locker(m_lock);
|
||||||
if (m_pending.size() >= m_backlog)
|
if (m_pending.size() >= m_backlog)
|
||||||
return ECONNREFUSED;
|
return ECONNREFUSED;
|
||||||
m_pending.append(peer);
|
if (!m_pending.try_append(peer))
|
||||||
|
return ENOMEM;
|
||||||
evaluate_block_conditions();
|
evaluate_block_conditions();
|
||||||
return KSuccess;
|
return KSuccess;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue