From: Ben Myers Date: Fri, 12 Feb 2010 19:00:52 +0000 (-0500) Subject: nfs-utils: dont leak fd in mountlist_list X-Git-Tag: nfs-utils-1-2-2~8 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=2ba89d65421cba255a0e75a7f646e4bbb2487193;p=nfs-utils.git nfs-utils: dont leak fd in mountlist_list Don't leak this file descriptor if stat should fail. Signed-off-by: Steve Dickson --- diff --git a/utils/mountd/rmtab.c b/utils/mountd/rmtab.c index b028529..19b22ee 100644 --- a/utils/mountd/rmtab.c +++ b/utils/mountd/rmtab.c @@ -24,6 +24,7 @@ #include "ha-callout.h" #include /* PATH_MAX */ +#include extern int reverse_resolve; @@ -187,7 +188,9 @@ mountlist_list(void) if ((lockid = xflock(_PATH_RMTABLCK, "r")) < 0) return NULL; if (stat(_PATH_RMTAB, &stb) < 0) { - xlog(L_ERROR, "can't stat %s", _PATH_RMTAB); + xlog(L_ERROR, "can't stat %s: %s", + _PATH_RMTAB, strerror(errno)); + xfunlock(lockid); return NULL; } if (stb.st_mtime != last_mtime) {