diff options
author | Ben Myers <bpm@sgi.com> | 2010-02-12 14:00:52 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2010-02-12 14:21:04 -0500 |
commit | 2ba89d65421cba255a0e75a7f646e4bbb2487193 (patch) | |
tree | c789228d0500fb3a4b8a89fec14a8c50f9987560 /utils/mountd | |
parent | a797fe77beb2748bebfa84e4d1d9033fbd65da57 (diff) | |
download | nfs-utils-2ba89d65421cba255a0e75a7f646e4bbb2487193.tar.gz nfs-utils-2ba89d65421cba255a0e75a7f646e4bbb2487193.tar.xz nfs-utils-2ba89d65421cba255a0e75a7f646e4bbb2487193.zip |
nfs-utils: dont leak fd in mountlist_list
Don't leak this file descriptor if stat should fail.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mountd')
-rw-r--r-- | utils/mountd/rmtab.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 <limits.h> /* PATH_MAX */ +#include <errno.h> 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) { |