=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/fetch.c,v retrieving revision 1.161 retrieving revision 1.162 diff -c -r1.161 -r1.162 *** src/usr.bin/ftp/fetch.c 2017/02/28 06:31:12 1.161 --- src/usr.bin/ftp/fetch.c 2017/03/02 09:29:53 1.162 *************** *** 1,4 **** ! /* $OpenBSD: fetch.c,v 1.161 2017/02/28 06:31:12 guenther Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: fetch.c,v 1.162 2017/03/02 09:29:53 sthen Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- *************** *** 1041,1046 **** --- 1041,1048 ---- fclose(fin); else if (s != -1) close(s); + if (out >= 0 && out != fileno(stdout)) + close(out); free(buf); free(proxyhost); free(proxyurl);