From: Masatake YAMATO Date: Tue, 12 Jul 2011 14:00:01 +0000 (-0400) Subject: exportfs: closing fd associated with /proc/fs/nfsd/export_features X-Git-Tag: debian/1%1.2.5-1~11^2~50 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=4cbf492fba6656c245c537e50379f80f4e66d0e7;p=nfs-utils.git exportfs: closing fd associated with /proc/fs/nfsd/export_features The fd associated with /proc/fs/nfsd/export_features opened in get_export_features is not closed. Acked-by: J. Bruce Fields Signed-off-by: Masatake YAMATO Signed-off-by: Steve Dickson --- diff --git a/support/nfs/exports.c b/support/nfs/exports.c index c250383..c96500f 100644 --- a/support/nfs/exports.c +++ b/support/nfs/exports.c @@ -784,8 +784,9 @@ struct export_features *get_export_features(void) fd = open(path, O_RDONLY); if (fd == -1) goto good; - fd = read(fd, buf, 50); - if (fd == -1) + c = read(fd, buf, 50); + close(fd); + if (c == -1) goto err; c = sscanf(buf, "%x %x", &ef.flags, &ef.secinfo_flags); if (c != 2)