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

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

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: ignore closehandle for windows

Co-authored-by: Robo <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Robo <hop2deep@gmail.com>
This commit is contained in:
trop[bot] 2025-06-24 21:12:21 +02:00 committed by GitHub
parent 42325294ab
commit 253d49b24f
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;
#endif
for (const auto& [io_handle, io_type] : stdio) {
if (io_handle == IOHandle::STDIN)
continue;
if (io_type == IOType::IO_PIPE) {
#if BUILDFLAG(IS_WIN)
HANDLE read = nullptr;