mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
Kernel: Avoid file descriptor leak in Process::sys$socketpair on error
Previously it was possible to leak the file descriptor if we error out after allocating the first descriptor. Now we perform both fd allocations back to back so we can handle the potential error when processing the second fd allocation.
This commit is contained in:
parent
4b2651ddab
commit
ddc950ce42
2 changed files with 12 additions and 10 deletions
|
@ -15,8 +15,8 @@ namespace Kernel {
|
|||
class FileDescription;
|
||||
|
||||
struct SocketPair {
|
||||
NonnullRefPtr<FileDescription> description0;
|
||||
NonnullRefPtr<FileDescription> description1;
|
||||
NonnullRefPtr<FileDescription> description2;
|
||||
};
|
||||
|
||||
class LocalSocket final : public Socket {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue