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

* 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 14:22:56 -04:00
committed by GitHub
parent cd42e9ba05
commit d4a93c896d

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;