Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/libexec/ftpd/ftpd.c,v rcsdiff: /ftp/cvs/cvsroot/src/libexec/ftpd/ftpd.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.202 retrieving revision 1.202.2.1 diff -u -p -r1.202 -r1.202.2.1 --- src/libexec/ftpd/ftpd.c 2015/08/10 07:32:49 1.202 +++ src/libexec/ftpd/ftpd.c 2016/07/26 03:24:15 1.202.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: ftpd.c,v 1.202 2015/08/10 07:32:49 shm Exp $ */ +/* $NetBSD: ftpd.c,v 1.202.2.1 2016/07/26 03:24:15 pgoyette Exp $ */ /* * Copyright (c) 1997-2009 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19 #if 0 static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: ftpd.c,v 1.202 2015/08/10 07:32:49 shm Exp $"); +__RCSID("$NetBSD: ftpd.c,v 1.202.2.1 2016/07/26 03:24:15 pgoyette Exp $"); #endif #endif /* not lint */ @@ -1967,7 +1967,8 @@ getdatasock(const char *fmode) t = errno; if (! dropprivs) (void) seteuid((uid_t)pw->pw_uid); - (void) close(s); + if (s >= 0) + (void) close(s); errno = t; return (NULL); }