[GIT PULL] fix file descriptor leak in is_mounted()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please pull from:

git://git.kernel.org/pub/scm/utils/util-linux-ng/tytso/util-linux-ng.git for_upstream

To get:

commit fdf08588af55d07a99b411708a08f4ebe6819706
Author: Theodore Ts'o <tytso@xxxxxxx>
Date:   Sat Oct 3 12:50:06 2009 -0400

    lib: fix file descriptor leak in is_mounted()
    
    Remove an extraneous fopen() that leaks memory and a file descriptor.
    
    Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>
---
 lib/ismounted.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/lib/ismounted.c b/lib/ismounted.c
index 28ae325..fbe91f9 100644
--- a/lib/ismounted.c
+++ b/lib/ismounted.c
@@ -70,9 +70,6 @@ static int check_mntent_file(const char *mtab_file, const char *file,
 	char		buf[1024], *device = 0, *mnt_dir = 0, *cp;
 
 	*mount_flags = 0;
-	if ((f = fopen(mtab_file, "r")) == NULL)
-		return errno;
-
 	if ((f = setmntent (mtab_file, "r")) == NULL)
 		return errno;
 	if (stat(file, &st_buf) == 0) {
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux