From 11d925c6089bd4a06efd686da202ec87d391b264 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 8 Dec 2008 15:32:44 +0100 Subject: [PATCH] blkid: fix file descriptor leak when checking for a module [kzak@redhat.com: port from e2fsprogs to util-linux-ng tree] Signed-off-by: Karel Zak --- libs/blkid/src/probers/ext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/blkid/src/probers/ext.c b/libs/blkid/src/probers/ext.c index 26cc679e..27f41419 100644 --- a/libs/blkid/src/probers/ext.c +++ b/libs/blkid/src/probers/ext.c @@ -371,8 +371,10 @@ static int check_for_modules(const char *fs_name) if (!strcmp(t, ".ko")) *t = 0; } - if (!strcmp(cp, fs_name)) + if (!strcmp(cp, fs_name)) { + fclose(f); return 1; + } } fclose(f); #endif /* __linux__ */ -- 2.39.5