mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-13 20:41:53 +00:00
LibWeb: Stop leaking socket fds when sending them over IPC
The implicit constructor for IPC::File does not take ownership of the file, which is surprising.
This commit is contained in:
parent
13abb1b2c7
commit
26ce8ad40f
Notes:
sideshowbarker
2024-07-16 22:58:46 +09:00
Author: https://github.com/ADKaster
Commit: 26ce8ad40f
Pull-request: https://github.com/SerenityOS/serenity/pull/23989
Reviewed-by: https://github.com/trflynn89
2 changed files with 4 additions and 4 deletions
|
@ -22,8 +22,8 @@ WebWorkerClient::WebWorkerClient(NonnullOwnPtr<Core::LocalSocket> socket)
|
|||
WebView::SocketPair WebWorkerClient::dup_sockets()
|
||||
{
|
||||
WebView::SocketPair pair;
|
||||
pair.socket = MUST(Core::System::dup(socket().fd().value()));
|
||||
pair.fd_passing_socket = MUST(Core::System::dup(fd_passing_socket().fd().value()));
|
||||
pair.socket = IPC::File(MUST(Core::System::dup(socket().fd().value())), IPC::File::CloseAfterSending);
|
||||
pair.fd_passing_socket = IPC::File(MUST(Core::System::dup(fd_passing_socket().fd().value())), IPC::File::CloseAfterSending);
|
||||
return pair;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue