summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2017-06-30 04:17:24 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2017-06-30 04:17:24 +0000
commit26976e741a2843315655e2670829e34483079112 (patch)
treef546cdbda28d15ee099a6cfcd25e07784d4a7839 /usr.bin/ssh
parented0bc368bffc96dcb25bb88479ed2484e6b5e933 (diff)
Only call close once in confree(). ssh_packet_close will close the FD
so only explicitly close non-SSH channels. bz#2734, from bagajjal at microsoft.com, ok djm@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/ssh-keyscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c
index c8237e8fe43..52191d156f7 100644
--- a/usr.bin/ssh/ssh-keyscan.c
+++ b/usr.bin/ssh/ssh-keyscan.c
@@ -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 <dm@lcs.mit.edu>.
*
@@ -370,7 +370,6 @@ confree(int s)
{
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 @@ confree(int s)
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--;