From 09a292ff1c8fa2b446f0af9b16e57457b1300276 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 3 Oct 2009 12:50:06 -0400 Subject: [PATCH] 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" --- lib/ismounted.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/ismounted.c b/lib/ismounted.c index 28ae3252..fbe91f9a 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) { -- 2.39.5