This patch prevents some file handles from accidentally being closed. Index: ftp.c =================================================================== RCS file: /insg/project/socks/socks5/clients/ftp/ftp.c,v retrieving revision 1.12.4.4 retrieving revision 1.12.4.5 diff -c -r1.12.4.4 -r1.12.4.5 *** ftp.c 1999/07/23 14:38:59 1.12.4.4 --- ftp.c 2000/02/24 15:28:05 1.12.4.5 *************** *** 913,918 **** --- 913,922 ---- if (closefunc != NULL) (*closefunc)(fin); fclose(dout); + if(data >= 0) { + close(data); + data = -1; + } getreply(0); Signal(SIGINT, oldintr); if (oldintp) *************** *** 1252,1257 **** --- 1256,1265 ---- gettimeofday(&stop, (struct timezone *)0); fclose(din); + if(data >= 0) { + close(data); + data = -1; + } getreply(0); if (bytes > 0 && is_retr) { ***************