Module Name: src
Committed By: christos
Date: Wed Nov 13 21:20:21 UTC 2013
Modified Files:
src/usr.sbin/ldpd: conffile.c
Log Message:
CID 1125876: File descriptor leak
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/ldpd/conffile.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/ldpd/conffile.c
diff -u src/usr.sbin/ldpd/conffile.c:1.8 src/usr.sbin/ldpd/conffile.c:1.9
--- src/usr.sbin/ldpd/conffile.c:1.8 Fri Oct 18 10:14:14 2013
+++ src/usr.sbin/ldpd/conffile.c Wed Nov 13 16:20:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: conffile.c,v 1.8 2013/10/18 14:14:14 kefren Exp $ */
+/* $NetBSD: conffile.c,v 1.9 2013/11/13 21:20:21 christos Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -121,8 +121,10 @@ conf_parsefile(const char *fname)
if (confh == -1 || fstat(confh, &fs) == -1 ||
(mapped = mmap(NULL, fs.st_size, PROT_READ, MAP_SHARED, confh, 0))
- == MAP_FAILED)
+ == MAP_FAILED) {
+ close(confh);
return E_CONF_IO;
+ }
mapsize = fs.st_size;
nextline = mapped;