3
0
forked from pool/util-linux
util-linux/util-linux-ng-bnc503008.patch
OBS User autobuild 7f31f0d86d Accepting request 23219 from Base:System
Copy from Base:System/util-linux based on submit request 23219 from user dirkmueller

OBS-URL: https://build.opensuse.org/request/show/23219
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=81
2009-10-27 15:47:32 +00:00

25 lines
754 B
Diff

commit fdf08588af55d07a99b411708a08f4ebe6819706
Author: Theodore Ts'o <tytso@mit.edu>
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@mit.edu>
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) {