summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-11-18 03:07:59 +0000
committerDamien Miller <djm@mindrot.org>2021-11-18 14:11:38 +1100
commit36b5e37030d35bbaa18ba56825b1af55971d18a0 (patch)
tree46020674d2b9fd098b7d3518e00e50424366b2a5 /sshd.c
parentb99498d0c93f1edd04857b318308a66b28316bd8 (diff)
downloadopenssh-git-36b5e37030d35bbaa18ba56825b1af55971d18a0.tar.gz
upstream: fd leak in sshd listen loop error path; from Gleb
Smirnoff OpenBSD-Commit-ID: a7a2be27a690a74bf2381bc16cea38e265657412
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sshd.c b/sshd.c
index 432fc5be..4e33cc92 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.581 2021/11/18 03:07:20 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.582 2021/11/18 03:07:59 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1264,8 +1264,10 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
continue;
}
if (unset_nonblock(*newsock) == -1 ||
- pipe(startup_p) == -1)
+ pipe(startup_p) == -1) {
+ close(*newsock);
continue;
+ }
if (drop_connection(*newsock, startups, startup_p[0])) {
close(*newsock);
close(startup_p[0]);