@@ -940,6 +940,8 @@ fhandler_pty_slave::open (int flags, mode_t)
940
940
errmsg = " can't call master, %E" ;
941
941
goto err;
942
942
}
943
+ CloseHandle (repl.to_slave_nat ); /* not used. */
944
+ CloseHandle (repl.to_slave ); /* not used. */
943
945
from_master_nat_local = repl.from_master_nat ;
944
946
from_master_local = repl.from_master ;
945
947
to_master_nat_local = repl.to_master_nat ;
@@ -1218,6 +1220,10 @@ fhandler_pty_slave::reset_switch_to_nat_pipe (void)
1218
1220
if (!CallNamedPipe (pipe, &req, sizeof req,
1219
1221
&repl, sizeof repl, &len, 500 ))
1220
1222
return ; /* What can we do? */
1223
+ CloseHandle (repl.from_master ); /* not used. */
1224
+ CloseHandle (repl.to_master ); /* not used. */
1225
+ CloseHandle (repl.to_slave_nat ); /* not used. */
1226
+ CloseHandle (repl.to_slave ); /* not used. */
1221
1227
CloseHandle (get_handle_nat ());
1222
1228
set_handle_nat (repl.from_master_nat );
1223
1229
CloseHandle (get_output_handle_nat ());
@@ -3932,10 +3938,20 @@ fhandler_pty_slave::transfer_input (tty::xfer_dir dir, HANDLE from, tty *ttyp,
3932
3938
if (!CallNamedPipe (pipe, &req, sizeof req,
3933
3939
&repl, sizeof repl, &len, 500 ))
3934
3940
return ; /* What can we do? */
3941
+ CloseHandle (repl.from_master_nat ); /* not used. */
3942
+ CloseHandle (repl.from_master ); /* not used. */
3943
+ CloseHandle (repl.to_master_nat ); /* not used. */
3944
+ CloseHandle (repl.to_master ); /* not used. */
3935
3945
if (dir == tty::to_nat)
3936
- to = repl.to_slave_nat ;
3946
+ {
3947
+ CloseHandle (repl.to_slave ); /* not used. */
3948
+ to = repl.to_slave_nat ;
3949
+ }
3937
3950
else
3938
- to = repl.to_slave ;
3951
+ {
3952
+ CloseHandle (repl.to_slave_nat ); /* not used. */
3953
+ to = repl.to_slave ;
3954
+ }
3939
3955
}
3940
3956
3941
3957
UINT cp_from = 0 , cp_to = 0 ;
@@ -4066,6 +4082,7 @@ fhandler_pty_slave::transfer_input (tty::xfer_dir dir, HANDLE from, tty *ttyp,
4066
4082
transfered = true ;;
4067
4083
}
4068
4084
}
4085
+ CloseHandle (to);
4069
4086
4070
4087
/* Fix input_available_event which indicates availability in cyg pipe. */
4071
4088
if (dir == tty::to_nat) /* all data is transfered to nat pipe,
0 commit comments