changeset 3701:fec29e0d1d48

6508208 File not closed on error path in mountd
author th199096
date Thu, 22 Feb 2007 19:22:48 -0800
parents 3a7e0afcf1b4
children 0c044e9df56a
files usr/src/cmd/fs.d/nfs/mountd/mountd.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/fs.d/nfs/mountd/mountd.c	Thu Feb 22 18:00:20 2007 -0800
+++ b/usr/src/cmd/fs.d/nfs/mountd/mountd.c	Thu Feb 22 19:22:48 2007 -0800
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -1998,6 +1998,7 @@
 
 	if (stat(SHARETAB, &st) != 0) {
 		syslog(LOG_ERR, "Cannot stat %s: %m", SHARETAB);
+		(void) fclose(f);
 		(void) rw_unlock(&sharetab_lock);
 		return;
 	}