fix: ensure /dev/null fd is closed on failure (#47525)

* fix: ensure /dev/null fd is closed on failure

* chore: ignore closehandle for windows

---------

Co-authored-by: Robo <hop2deep@gmail.com>
This commit is contained in:
Shelley Vohr 2025-06-24 17:44:50 +02:00 committed by GitHub
commit 51fbc964a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,6 +78,9 @@ UtilityProcessWrapper::UtilityProcessWrapper(
base::FileHandleMappingVector fds_to_remap; base::FileHandleMappingVector fds_to_remap;
#endif #endif
for (const auto& [io_handle, io_type] : stdio) { for (const auto& [io_handle, io_type] : stdio) {
if (io_handle == IOHandle::STDIN)
continue;
if (io_type == IOType::IO_PIPE) { if (io_type == IOType::IO_PIPE) {
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
HANDLE read = nullptr; HANDLE read = nullptr;