=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keyscan.c,v retrieving revision 1.114 retrieving revision 1.115 diff -u -r1.114 -r1.115 --- src/usr.bin/ssh/ssh-keyscan.c 2017/05/31 07:00:13 1.114 +++ src/usr.bin/ssh/ssh-keyscan.c 2017/06/30 04:17:23 1.115 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keyscan.c,v 1.114 2017/05/31 07:00:13 markus Exp $ */ +/* $OpenBSD: ssh-keyscan.c,v 1.115 2017/06/30 04:17:23 dtucker Exp $ */ /* * Copyright 1995, 1996 by David Mazieres . * @@ -370,7 +370,6 @@ { if (s >= maxfd || fdcon[s].c_status == CS_UNUSED) fatal("confree: attempt to free bad fdno %d", s); - close(s); free(fdcon[s].c_namebase); free(fdcon[s].c_output_name); if (fdcon[s].c_status == CS_KEYS) @@ -381,7 +380,8 @@ ssh_packet_close(fdcon[s].c_ssh); free(fdcon[s].c_ssh); fdcon[s].c_ssh = NULL; - } + } else + close(s); TAILQ_REMOVE(&tq, &fdcon[s], c_link); FD_CLR(s, read_wait); ncon--;