Skip to content

Commit 6cf978b

Browse files
committed
FIX critical ressource leak
As refered to on this page: https://doc.rust-lang.org/std/process/struct.Child.html you need to wait() each child process to make sure the ressources are properly freed. This was actually causing the program to crash when calling a command containing a pipe in a loop.
1 parent b03088c commit 6cf978b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ fn run_full_cmd(process: &mut Process, pipe_last: bool) -> Result<(Child, String
336336
Stdio::piped()
337337
})
338338
.spawn()?;
339+
last_proc.wait();
339340
last_proc = new_proc;
340341
}
341342

0 commit comments

Comments
 (0)