summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-29 03:43:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-29 03:43:55 +0000
commitf7fc93cf8bf9cb857ced34ba9c6bf7dd2a44f673 (patch)
tree1c14b7a312f246e4caba74ba561fead25cdba87e
parentd34fe2d7601f25b62a01d896be8d8d8c198e3575 (diff)
from port 20, do not leak an fd
-rw-r--r--usr.sbin/inetd/inetd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index d314f73930d..95b4b5355b9 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.8 1996/07/28 05:54:41 deraadt Exp $ */
+/* $OpenBSD: inetd.c,v 1.9 1996/07/29 03:43:54 deraadt Exp $ */
/* $NetBSD: inetd.c,v 1.11 1996/02/22 11:14:41 mycroft Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/
-static char rcsid[] = "$OpenBSD: inetd.c,v 1.8 1996/07/28 05:54:41 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: inetd.c,v 1.9 1996/07/29 03:43:54 deraadt Exp $";
#endif /* not lint */
/*
@@ -385,11 +385,13 @@ main(argc, argv, envp)
if (getpeername(ctrl, (struct sockaddr *)&peer,
&plen) < 0) {
syslog(LOG_WARNING, "could not getpeername");
+ close(ctrl);
continue;
}
if (ntohs(peer.sin_port) == 20) {
syslog(LOG_INFO, "Connect to %s from port %d",
sep->se_service, ntohs(peer.sin_port));
+ close(ctrl);
continue;
}
} else