From 4343ba6695d9de47a055ae411983029d61b6ea3e Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 5 Jan 2024 11:04:16 +0100 Subject: [PATCH] fuzz: fix file descriptor leak --- fuzz/fuzz_targets/fuzz_common.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fuzz/fuzz_targets/fuzz_common.rs b/fuzz/fuzz_targets/fuzz_common.rs index 0201ffd89c2..f0de0b6052f 100644 --- a/fuzz/fuzz_targets/fuzz_common.rs +++ b/fuzz/fuzz_targets/fuzz_common.rs @@ -149,6 +149,10 @@ where exit_code: -1, }; } + unsafe { + close(original_stdout_fd); + close(original_stderr_fd); + } // Restore the original stdin if it was modified if let Some(fd) = original_stdin_fd {