Module Name:    src
Committed By:   wiz
Date:           Tue Jan  4 10:30:21 UTC 2011

Modified Files:
        src/usr.sbin/user: user.c

Log Message:
Close masterfd after reading from it. Found by cppcheck.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/usr.sbin/user/user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/user/user.c
diff -u src/usr.sbin/user/user.c:1.125 src/usr.sbin/user/user.c:1.126
--- src/usr.sbin/user/user.c:1.125	Thu Dec 31 19:59:31 2009
+++ src/usr.sbin/user/user.c	Tue Jan  4 10:30:21 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.125 2009/12/31 19:59:31 mlelstv Exp $ */
+/* $NetBSD: user.c,v 1.126 2011/01/04 10:30:21 wiz Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: user.c,v 1.125 2009/12/31 19:59:31 mlelstv Exp $");
+__RCSID("$NetBSD: user.c,v 1.126 2011/01/04 10:30:21 wiz Exp $");
 #endif
 
 #include <sys/types.h>
@@ -1115,6 +1115,7 @@
 			    "short write to /etc/ptmp", login_name);
 		}
 	}
+	(void)close(masterfd);
 	/* if no uid was specified, get next one in [low_uid..high_uid] range */
 	sync_uid_gid = (strcmp(up->u_primgrp, "=uid") == 0);
 	if (up->u_uid == -1) {

Reply via email to