1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibIPC: Do not leak the Core::File fd by default

This prevents fd leaks when the user of the API forgets to pass
CloseAfterSending to IPC::File. Since we are calling leak_fd in the
constructor, we want it to also take care of closing.
This commit is contained in:
Sebastian Zaha 2023-07-10 15:52:26 +02:00 committed by Tim Flynn
parent 318a3a0822
commit 88872ca42d
3 changed files with 5 additions and 6 deletions

View file

@ -120,7 +120,7 @@ private:
if (file.is_error())
client().async_handle_file_return(file.error().code(), {}, request_id);
else
client().async_handle_file_return(0, IPC::File(*file.value(), IPC::File::CloseAfterSending), request_id);
client().async_handle_file_return(0, IPC::File(*file.value()), request_id);
}
void notify_server_did_finish_handling_input_event(bool) override { }