Skip to content

Commit

Permalink
upstream: fd leak in sshd listen loop error path; from Gleb
Browse files Browse the repository at this point in the history
Smirnoff

OpenBSD-Commit-ID: a7a2be27a690a74bf2381bc16cea38e265657412
  • Loading branch information
djmdjm committed Nov 18, 2021
1 parent b99498d commit 36b5e37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 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
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit 36b5e37

Please sign in to comment.